-->
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: unsaved-value and sequence
PostPosted: Thu Feb 26, 2004 2:20 pm 
Regular
Regular

Joined: Thu Nov 20, 2003 10:44 am
Posts: 58
Location: Paris, France
Dear all,
I have the following mapping :

Quote:
<hibernate-mapping>
<class name="EserviceElemPersistent" table="ESERVICE_ELEM">
<id name="numEserviceElem" column="PK_ESERVICE_ELEM" unsaved-value="0">
<generator class="sequence">
<param name="sequence">S_ESERVICE_ELEM</param>
</generator>
</id>

</class>
</hibernate-mapping>


I don't know if unsaved-value and sequence are compliant. Actually, even if the key is different from 0, Hibernate creates a new sequence number when saving my object.
Therefore, is it possible to have a sequence and setting unsaved-value or does hibernate trigger each time the sequence ?
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2004 6:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
unsaved-value is just used for cascades and saveOrUpdate, if you use session.save() Hibernate will of course allways save your object and therefore generate an id for it.


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.