PersistenceUnitUtil.getIdentifier() returns the plain identifier
PersistenceUnitUtil.getIdentifier() previously returned the internal org.apache.openjpa.util.OpenJPAId wrapper (LongId, StringId, …) for managed entities and null for new, detached or unenhanced entities and for non-entities.
It now returns the raw identifier value (the plain key or the IdClass instance for compound identity), also for new, detached and unenhanced entities, and throws IllegalArgumentException for objects that are not entities.
Code that cast the result to OpenJPAId must use the plain value or call OpenJPAEntityManager.getObjectId().