Hello,
I have a class hierarchy something like this:
* abstract main data class
* non-abstract class with businnes methods, extending the abstract main data class
I'm using xdoclet with @hibernate/<hibernatedoclet> to generate the mappings for hibernate. Those tags are only present in the main data-class, since subclass is dynamically generated (using <ejbdoclet>) and does not hold any persistent data.
So the .hbm.xml files have mappings for the main data class only.
Now, when trying to use hibernate to e.g. save() :
Code:
main_data_class data = (main_data_class)instanceOfDerivedClass;
session.save( data );
.. i get HibernateException: Unknown entity class: <Derived classname>.
My conclusion atm is that hibernate can only persist non-abstract classes, which actually would complicate my design a bit - is there a way around this ? Or am I doomed to make mappings for all generated classes/make a non-abstract data class ?