-->
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: TableGenerator and Constraint Error Question
PostPosted: Wed Jul 28, 2004 3:46 pm 
Newbie

Joined: Mon Nov 17, 2003 11:04 am
Posts: 5
I'm using TableGenerator to generate Ids.
This is my configuration:
Code:
<id
  name="id"
  column="id"
  type="java.lang.Integer"
  unsaved-value="null">
  <generator class="net.sf.hibernate.id.TableGenerator">
    <param name="table">app_primary_key</param>
    <param name="column">next_id</param>
  </generator>
</id>

When I save a new record everything works fine. The new record gets the correct id and the key table (app_primary_key) updates the value.
But If the new record have a constraint error (for example duplicate value on a unique field) the key table is updated although the new record is not saved.
I prefer that if the record is not saved the key table manteins the same value, is this possible?

Thanks, Claudio. (apologize for my english)


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.