-->
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.  [ 2 posts ] 
Author Message
 Post subject: ID generated by trigger with composite natural key
PostPosted: Thu Aug 25, 2005 9:40 am 
Newbie

Joined: Thu Aug 25, 2005 9:34 am
Posts: 1
Is it possible to have an ID generated by a trigger and retrieved with a select by a composite key? I assume the mapping would be like this, is it correct?


Code:
<id name="id" type="long" column="person_id">
        <generator class="select">
                <param name="key">driversLicenseIssuer</param>
                <param name="key">driversLicenseNumber</param>
        </generator>
</id>


Top
 Profile  
 
 Post subject: No
PostPosted: Thu Aug 25, 2005 11:36 am 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
It is not going to work.
SelectGenerator class expects just one 'key' parameter. Therefore you may need to write your own extended select generator, take a glance at org.hibernate.id.SelectGenerator for an inspiration.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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

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.