如何在Hibernate 4和Spring中使用注釋來定義不同類型的關(guān)系?我有兩個班,F(xiàn)oo并且Bar,具體如下:public class Foo {
private Long fooId;
private Bar bar;
//Yes, this doesn't actually make any sense,
//having both a list and a single object here, its an example.
private List<Bar> bars;}public class Bar {
private Long barId;
private Foo foo;}如何使用Hibernate 4的注釋為這些類實現(xiàn)(單向/雙向)一對多,多對一或多對多關(guān)系?另外,我如何配置我的一對多的孤兒刪除,延遲加載以及什么原因?qū)е翷azyInitialiaizationException處理集合以及如何解決問題?
添加回答
舉報
0/150
提交
取消