Recursive Relationship with Hibernate?

From: Aquila Deus (aquila.deus_at_gmail.com)
Date: 02/27/05


Date: 27 Feb 2005 03:10:32 -0800

Hi all!

When I try to use recursive relationship in Hibernate (v3 beta 4), it
gives me this:

java.lang.NullPointerException
  at org.hibernate.cfg.HbmBinder.bindMapSecondPass(HbmBinder.java:1692)
  at
org.hibernate.cfg.HbmBinder$MapSecondPass.secondPass(HbmBinder.java:2160)
  at
org.hibernate.cfg.HbmBinder$SecondPass.doSecondPass(HbmBinder.java:2113)
  at
org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:841)
  at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1024)
  at
bspccm.test.HibernateTestServlet.init(HibernateTestServlet.java:38)

And I also found this:
http://jroller.com/comments/sftarch/Weblog/what_we_dumped_hibernate

which says hibernate couldn't handle recursive relationship, but there
is no other info. Is recursive rel really unsupported??

BTW, my class is a directory-like object: It has a parent and a
children map, which all refer to the same table. And there will be a
Permission table and Role/User to implement ACL-like mechanism. If
Hibernate isn't suitable for this, is there any better solution?