Reputation: 39
I have the name of a table .
I want to retrieve entity class of this table in Spring JPA
.
The table name may differ from its entity class name.
I searched for a lot, but the solutions were to find the table name using the entity class . That is, quite the inverse is what I need.
Do you have any suggestions for this problem?
Upvotes: 1
Views: 378
Reputation: 25936
Assuming you know how to map entity class to a table name, you can get a list of all entity classes using JPA metamodel API, and subsequently build a complete inverse mapping.
Upvotes: 1