Hi guys,
I've been trying to do the generated code as base class, custom code as extension pattern using
Code:
<class name="Owner"...>
<meta attribute="generated-class" inherit="false">BaseOwner</meta>
...
Here's the wrinkle -- my classes reference each other, so hbm2java wants to return an Owner object. This causes a MappingException because only BaseOwner exists. Of course, I WANT this function to return Owner (not BaseOwner) so that the returned object has my custom code.
Does anyone know a way around this? One solution I've considered is adding an empty union-subclass with generated-class = Owner, and extending code from there. But this seems like a kludge as it falsely implies a distinction in the schema, and because I will have to move my custom code to protect it on re-generation.
Thanks for ideas,
G