Optionally provide an id explicitly when using a sequence generator with Hibernate

Solution Verified - Updated -

Issue

  • Need to provide an identifier explicitly for certain entities (e.g. when testing)
  • For other entities of the same type, need the identifier to be sequence generated (e.g. in production)
  • Will use lower values than the sequence base for explicitly provided identifiers

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 5
  • Hibernate 3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content