-->
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: Valued pulled from sequence not being used as ID
PostPosted: Thu May 01, 2008 9:09 am 
Newbie

Joined: Fri May 20, 2005 6:05 am
Posts: 8
I am using Hibernate Core 3.2.6 G with Hibernate Annotations 3.3.1 GA.

My id field has the following

Code:
@SequenceGenerator(name= "name", sequenceName = "seqName")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="name")


when viewing the sql the sequence is called just fine, but the insert does not use the key that came from the sequence, it uses some other value that I have no clue where it came from.

All the examples I can find list this as the correct way to use a sequence.

Any help would be great.

thanks

OK so I got it to work by removing
Code:
strategy = GenerationType.SEQUENCE
is there any reason that should cause the behavior I had?


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.