Is it possible to determine the native table name of an entity?
If a Table annotation is present it’s easy:
entityClass.getAnnotation(Table.class).name()
But what about if no Table annotation is present?
Hibernate provides this information via the Configuration class:
configuration.getClassMapping(entityClass.getSimpleName()).getTable().getName()
Is there something similar in JPA?
If no table annotation is present (and no ORM.xml) then in JPA the table name is formed based on the class name (see the JPA spec). Hence why exactly do you need an accessor method ?
See http://www.datanucleus.org/products/accessplatform_2_0/jpa/orm/datastore_identifiers.html