-->
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: @GeneratedValue Strategy when inserting entries not by hiber
PostPosted: Thu May 14, 2009 10:44 am 
Newbie

Joined: Thu May 14, 2009 10:21 am
Posts: 1
Hello

what kind of entity id generation strategy do I have do define, by the following scenario:

my current entity id annotation is:

Code:
  @Id @GeneratedValue
  public int getId() {
    return _id;
  }


The scenario is:

1. let hibernate create my db schema by hibernate.hbm2ddl.auto = create
2. import data 'manually' (ant, not hibernate)
3. run the application with hibernate and the setting hibernate.hbm2ddl.auto = validate
=> causes the following execption
Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: ...

I'm aware that I confused hibernates id generation, because I imported the entries manually.
Is there a way to update hibernates id counter?

Thank you for any hint.
Regards,
Andrae


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.