Created
February 5, 2019 13:30
-
-
Save michmzr/7dfc6c43f8e504335e28e3645bb9a2fc to your computer and use it in GitHub Desktop.
Get Domain object table name by hibernate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sessionFactory = Holders.applicationContext.getBean('sessionFactory') | |
ClassMetadata hibernateMetaClass = sessionFactory.getClassMetadata(User) | |
def mappedTable = hibernateMetaClass.getTableName() | |
print("User domain class is mapped to database table '$mappedTable') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment