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)
|