我有如下实体存根:
@Entity
public class Company extends AbstractEntity{
private String name;
private String address;
private String zipCode;
private String city;
private String owner;
private String website;
private String emailAddress;
private String phoneNumber;
private String faxNumber;
private List<Category> categories;
private Map<Category, ServiceType> serviceType;
}
如您所见,这里的目标是创建一个映射 ( serviceType
),其中键是另一个集合属性的成员(这里的属性是categories
)。换句话说,我想ServiceType
获取Category
存储categories
;
Category
是另一个映射实体;我如何使用注释来实现该目标?使用Hibernate 4.2.1.Final