-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: associations to self
PostPosted: Wed Apr 20, 2005 7:30 am 
Newbie

Joined: Tue Apr 12, 2005 10:46 am
Posts: 2
I have two classes, A and B, where B extends A.

A is persistent : @hibernate.class table="ATable"
A has some nice properties that are persistent, so far so good.
However, A also has a property B (recall B is a subclass).

Tagging A.getB() with : @hibernate.many-to-one column="b" class="B" is not successful. SchemaExport yields error "MappingException : Could not find class B".

B is tagged as follows : @hibernate.subclass table="ATable"

I guess the error comes from the fact that as schemaexport processes A.hbm.xml, it encounters a reference to B.hbm.xml which does not exist ("B.hbm.xml" is really bundled in "A.hbm.xml" due to inheritance).

While isolating my problem, I also experience that the inheritance is not the only problem here. The same story applied if I change the association to B with an association to self (A).

It looks like schemaexport cannot continue because while processing A, it needs to process A, ...., .....

How do I resolve this kind of assocation?
(Yes, I agree the assocation may be somewhat weird, but the association is there for a good reason)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.