ObjectDB ObjectDB

Internal Website Search

1-5 of 5 resultsRefresh


Method javax.persistence.PersistenceUnitUtil Object getIdentifier( Object entity ) Return the id of the entity. A generated id is not guaranteed to be available until after the database insert has occurred. Returns null if the entity does not yet have an id. Parameters: entity - entity instance

JPA Primary Key

.getPersistenceUnitUtil(); Object projectId = util.getIdentifier(project); A PersistenceUnitUtil instance is obtained from the EntityManagerFactory. The getIdentifier method takes one argument, a managed entity

Populating entity id before transaction commit

you can force early auto ID setting by: Object id = emf.getPersistenceUnitUtil().getIdentifier(); support

Entity listener - event instead of object

entityId = event.getPersister().hasIdentifierProperty() ? event.getPersister().getIdentifier(event


for this persistence unit or on new entity instances. Since: JPA 2.0 Object getIdentifier(Object

Getting Started

ObjectDB is very easy to use. Follow the Getting Started Tutorial and the Quick Tour manual chapter and in minutes you may be able to write and run first Java programs against ObjectDB.

Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.

Need Help?

  1. Search ObjectDB website
  2. Read the FAQ
  3. Follow the Tutorials
  4. View or post in the forum
  5. Search or file an issue
  6. Contact support