This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Using Oracle squence in Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Using Oracle squence in Hibernate" Watch "Using Oracle squence in Hibernate" New topic

Using Oracle squence in Hibernate

gi tos

Joined: May 15, 2012
Posts: 12

I want to use an Oracle sequence with hibernate.

the problem is that the sequence will not be use as an ID. But to update a field when some conditions are available.

so I want to do something like this:

update MY_TABLE set NUM_VAL = select MY_SEQ.nextval

I found many examples but all of theme are talking about a sequence that is user as an ID:

wood burning stoves
subject: Using Oracle squence in Hibernate
Similar Threads
Hibernate : Could not parse mapping document from resource
sequence generator with mysql
inverse=true in many-to-many doubt
Many to Many Mapping: Link table not getting updated
Cannot generate a non-primary-key field in hibernate