JPA Method
in jakarta.persistence.PersistenceUnitUtil

Object getVersion(
  Object entity
)


Return the version of the entity. A generated version 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
Return:
id of the entity
Throws:
IllegalArgumentException - if the object is found not to be an entity
Since:
JPA 3.2