• 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:

 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!