Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 2 节课:
@Entity class A{ @Id long id @??? List<B> bs; } @???? class B{ @ManyToOne A a; @OneToOne C c; Integer a,b,c,d,e; }
我怎样才能让休眠来处理它?我不想将 id 放在 B 类上,因为它是一个弱实体?
你所说的“弱”实体是什么意思?只是没有身份证?采用
@ElementCollection List<B> bs;
随着
@Embeddable class B {}
在此处查找示例