-->
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: Problem with Sequences
PostPosted: Tue May 24, 2011 10:16 pm 
Newbie

Joined: Thu May 28, 2009 12:28 pm
Posts: 11
Hello,

I have a PostgreSQL Table that have a default clause in the ID column that use a sequence to get the default value. That's ok, but I don't know how to configure it with Hibernate. The problem is that Hibernate can't accept a entity to be persisted without Id, but the Id will be generated after the insert.

From all the Generator Strategies the only one that work is IDENTITY, but it'll won't bring the correct ID after the insert, instead it will generate a id 0!

Any ideas?


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.