How to retrieve mapping table name for an entity in JPA at runtime?
Clash Royale CLAN TAG #URR8PPP How to retrieve mapping table name for an entity in JPA at runtime? Is it possible to determine the native table name of an entity? If a Table annotation is present it's easy: Table entityClass.getAnnotation(Table.class).name() But what about if no Table annotation is present? Table Hibernate provides this information via the Configuration class: Configuration configuration.getClassMapping(entityClass.getSimpleName()).getTable().getName() Is there something similar in JPA? as far as i know this is indeed not part of the standard API, so you will have to rely on the actual implementation (hibernate, toplink, ...) to get what you want – Stefan De Boey Feb 26 '10 at 14:40 5 Answers 5 If no table annotation is presen...