Recursive Relationship with Hibernate?

A

Aquila Deus

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?
 
A

Aquila Deus

Aquila said:
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)
org.hibernate.cfg.HbmBinder$MapSecondPass.secondPass(HbmBinder.java:2160)
org.hibernate.cfg.HbmBinder$SecondPass.doSecondPass(HbmBinder.java:2113)
org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:841)
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?

hmmm.. I guess I choosed a wrong subject. Anyway, I have decided to
give up any ORM for the project and write sp instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top