-->
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: joined-subclass has second unique key...
PostPosted: Thu Dec 22, 2005 3:33 pm 
Newbie

Joined: Fri Aug 05, 2005 12:03 pm
Posts: 5
I'm trying to map a legacy system where there is effectively a perfectly reasonable joined-subclass situation, but the table for the subclass not only carries the primary key from the parent, but also has its own unique key which is generated from an oracle sequence generator.

How might I map an extra property (column) to get get the next val from a sequence generator on insert?

I had hoped to use something like this, but it doesn't work:

<joined-subclass name="Color" table="COLOR">
<key column="PARENT_ID" />
<property name="brand" column="BRAND" />
<property name="secondKey" column="SECOND_KEY">
<generator class="sequence">
<param name="sequence">PARENT_GEN</param>
</generator>
</property>
</joined-subclass>

Yes, the second key is useless and should not be there. However, it is, and can't go away without breaking the old code.


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.