1

I have a hibernate issue where I have three layer of data, Parent-Child-Grandchild, Parent to Child one to many and child to grand child one to many. I am unable to save data when I say parent save (hibernate session save method), I use cascade.ALL. I am able to save two layer, parent to child one to many. What I need to do in this case. I have one parent record which has two child records and each child record has three grand child record. Please help.

4

1 回答 1

-1

您需要一个自我引用的一对多关系。您需要多少级别并不重要。

这是一个很好的教程,可以指导你:http: //viralpatel.net/blogs/hibernate-self-join-annotations-one-to-many-mapping/

于 2013-04-08T02:50:41.790 回答