• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting column name from ColumnMetaData

 
pramodh somashekara
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, how to get actual database column name from ColumnMetaData api if I know only the 'mapping file name', and the corresponding bean class?

pramodh
 
Lakshmi Dasari
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You can use hibernate's "PersistentClass" to get the entity mapping information at runtime. You can get the mapping class for a persistent entity say "User" with the code below and explore the Table class apis for getting the columns of the table. For Eg:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic