Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate mapping a self referencing object

 
Shanika Weerapperuma
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a newbie to Hibernate, having a problem in doing a self referenced object mapping in hbm.xml.

I have the DAO for the following senario :

class Person {

String id;
String name;
Person[] child;

}


What will be the mapping for this kind of situation? Also how do i write a single query in HQL to get the Person object with a filled child array as the query result?


Please help.

thanks
s

[ July 30, 2004: Message edited by: Shanika Weerapperuma ]Person

[ July 30, 2004: Message edited by: Shanika Weerapperuma ]
[ July 30, 2004: Message edited by: Shanika Weerapperuma ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic