标签: java hibernate mapping
我有2个班级:
@Entity class A{ @Id long id @??? List<B> bs; } @???? class B{ @ManyToOne A a; @OneToOne C c; Integer a,b,c,d,e; }
我如何让hibernate来处理它? 我不想把ID放在B级,因为它是一个弱实体?
答案 0 :(得分:2)
“弱”实体是什么意思?它只是没有ID?使用
@ElementCollection List<B> bs;
与
@Embeddable class B {}
查找实例here