I 'd like to define a PersistantObject superclass and same myself a lot of typing on every subclass by defining a superclass mapping like this:
Code:
<class name="x.y.PersistableObject" abstract="true">
<id name="databaseId" type="java.lang.Long">
<generator class="native"/>
</id>
<version name="version" type="long"/>
</class>
And a subclass mapping like this:
Code:
<union-subclass name="x.y.Dog"
extends="x.y.PersistableObject">
<property name="name"/>
<!-- ... -->
</union-subclass>
But apperently Hibernate doesn't support this: "native generator inhertance"?
How can I avoid having to write the id and version tag in every file again?