Hello,
I'm wondering if anyone has tried to override the id generator type for union-subclasses? I've got a base object that I use for all domain objects...it has an ID attribute that's a string. In my hibernate mapping, I have it defined as uuid.hex. Everything works nicely.
But now, we're realizing that not all domain object need to have a uuid...its overkill for some objects. So I tried to override the <id> tag inside the union-subclass, but I get a mapping exception since that's not defined in the DTD.
My question is, why is this a limitation? I've got the mapping defined below. Not including the source since its simple accessors/mutators.
John
---
Mappings:
<class name="com.foo.DomainObject" abstract="true">
<id name="id" type="string" column="ID" length="32">
<generator class="uuid.hex"/>
</id>
</class>
<union-subclass name="com.foo.Operator" extends="com.foo.DomainObject" table="OPERATOR">
<id name="id" type="string" column="ID" length="32">
<generator class="sequence"/>
</id>
<property name="firstName" type="string" column="FIRST_NAME" not-null="true" length="50"/>
<property name="lastName" type="string" column="LAST_NAME" not-null="true" length="50"/>
</union-subclass>
|