getIdentifier(entity) - JPA PersistenceUnitUtil's method

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
Returns:
id of the entity
Throws:
IllegalArgumentException - if the object is found not to be an entity
Since:
JPA 2.0