-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: overriding id generator type for union-subclass
PostPosted: Mon Aug 01, 2005 2:32 pm 
Newbie

Joined: Tue Jun 07, 2005 1:08 pm
Posts: 10
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>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.