-->
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 ==> <generator class="select">
PostPosted: Fri Jun 16, 2006 6:32 am 
Beginner
Beginner

Joined: Thu Apr 14, 2005 4:29 am
Posts: 28
Hi,

I used <generator class="select"> (database triggered primary key) with one param element. This worked but I need more than one to define a unique key.

It is possible to define more than one key in <generator class="select">?

I tried several mappings but nothing worked for instance:
Code:
<id name="id" type="long" column="GAMENR">
         <generator class="select">
            <param name="key">from</param>
            <param name="key">until</param>
            <param name="key">personID</param>
      </generator></id>

Only the last <key> element will be used.

If I save a game Hibernate should after the insert do a select with the following where clause:
Code:
WHERE from="2006-01-01" AND until="2006-01-10" AND personID=541


Thanks,
Detlev

Hibernate version: 3.1.3


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 17, 2006 4:43 am 
Beginner
Beginner

Joined: Thu Apr 14, 2005 4:29 am
Posts: 28
Does I need my own custom id generator class to do this?

Regards,
Detlev


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.