JPA Method
in jakarta.persistence.PersistenceUnitUtil

Class<?extendsT> getClass(
  T entity
)


Return the concrete entity class if the given entity belonging to the persistence unit and to an open persistence context. This method may, but is not required to, load the given entity by side effect.
Parameters:
entity - entity instance
Return:
an entity class belonging to the persistence unit
Throws:
IllegalArgumentException - if the given object is not an instance of an entity class belonging to the persistence unit
PersistenceException - if the entity is not associated with an open persistence context or cannot be loaded from the database
Since:
JPA 3.2