0
我有一个实体和相关的IdClass。JPA 2.0 IdClass字段名称映射
@Entity
@IdClass(MyEntityId.class)
class MyEntity {
@Id @ManyToOne You you; <---------------------|
@Id @ManyToOne He he; ------------------------+---------|
} | |
| @@? |
class MyEntityId { | | @@?
Long you; <-----------------------------------| |
Long he; <----------------------------------------------|
}
是不是没有任何MapsId
什么的?
不JPA自动映射you
到you
和he
到he
?
谢谢。 JPA 2.0是否可以直接在'@ ManyToOne'上注释'@ Id'? [示例JPA 2.0 ManyToOne id注释](http://en.wikibooks.org/wiki/Java_Persistence/Identity_and_Sequencing#Example_JPA_2.0_ManyToOne_id_annotation) – 2012-03-21 00:59:45