Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling sequences in hibernate

 
Viswanath Sriram
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How to call sequences from hibernate.I want the sequence value.

(Removed E-mail so the user doesn't get tons more spam - Mark)
[ July 20, 2006: Message edited by: Mark Spritzler ]
 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no. please do not email.
please use the forum to give an answer (or is your email account also indexed by the javaranch search ?)

cheers
pascal
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you have configured the ID to use the sequence already using generator set to sequence, then giving it the name of the sequence.

You can always write SQL to call a query like "select seq.currval from dual" and run it. or use nextval instead of currval.

Why do you need it, should you just let Hibernate when it calls insert to use the sequence, and then I believe after that you can get what was set into the Object.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic