我有两个表(已经创建),说 Person 和 Address 具有以下模式:
create table Person (
`id` int(11) not null auto_increment,
`name` varchar(255) default null,
primary key(`id`)
)
create table Address (
`id` int(11) not null,
`city` varchar(255) default null,
primary key (`id`),
constraint foreign key (`id`) references `Person`(`id`)
)
现在,我应该在代码中使用哪些注释?
这两个类的骨架是:
class Person {
@Id @GeneratedValue
@Column(name="id")
int id;
String name;
Address address;
}
class Address {
int id;
}
我需要为Person类中的地址字段和Address类的id字段添加注释。