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: sequence value for a property
PostPosted: Fri Jun 29, 2007 5:43 am 
Newbie

Joined: Sat Apr 07, 2007 6:53 am
Posts: 16
I have got an entity that has a property that have to be generated via a sequence. This property isn't a id, so I can't spicify generator tag.

So,

Code:
<class name="Model.Utilitari" table="ARTICLES_UBICACIONS">
      <id name="Codi_intern" column="UTILITARI" unsaved-value="-1">
         <generator class="increment"/>
         <!--   <param name="sequence">SERIE_SEQUENCE</param>
         </generator>-->
      </id>
      <property name="Serie" column="SERIE" unique="true"/>
...


So, I need a sequence that generate me a number for SERIE property. How Can I do it? I've created a sequence into database named SERIE_SEQUENCE, but I don't know How Can I call next value in order to set it to SERIE property.

Thanks.


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.