假设我有这样的课程
@Entity
public class Customer implements Serializable {
private int id;
private String firstName;
private String lastName;
private Referee referee;
private Collection<Address> addresses;
private Collection<Account> accounts;
.....
} //end of class Customer
@Entity
public class Referee implements Serializable {
private int id;
private String name;
private String comments;
....
} //end of class Referee
@Entity
public class Account implements Serializable {
private int id;
private double balance;
private String accountType;
...
}
@Entity
public class Address implements Serializable {
private int id;
private String addressLine;
private String country;
private String postCode;
...
}
现在,如果我在名为 Customer 的数据库中创建表。那么我将使用什么类型作为类型Referee
,Collection<Address>
和Collection<Account>
。就像我制作列 id 一样,它的类型将是INTEGER
,字符串更改为,VARCHAR
但我将什么类型用于收集和裁判?谢谢