Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

hibernate 3 - get table name from metadata

sergio martinelli
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I can't get table name from a mapped class in this way using Hibernate3:

Session session = InitSessionFactory. getInstance( ).getCurrentSession();
BasicEntityProperty classMetadata = (BasicEntityPropert y)session. getClassMetadata (employee.class) ;
classMetadata. getTableName( );

with hibernate2 I did it with this three simple lines of code.

Now I can't find nothing simple like that, is really hard get the table name from a mapped pojo.
Looking in the SessionFactory or Configuration class find something but I don't find the way.

Plase some help!
My english stinks... I know!

What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!