-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Finding the table associated with a class
PostPosted: Tue Feb 10, 2004 12:17 pm 
Newbie

Joined: Tue Oct 14, 2003 12:02 pm
Posts: 11
Location: Romania
Hi,

is there a possibility to find out using the Hibernate API to which table in the database a specific class is asociated? Is it possible using the SessionFactory.getClassMetadata(Item.class)?

Thanks,

Florin


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 10, 2004 12:25 pm 
Senior
Senior

Joined: Sun Jan 04, 2004 2:46 pm
Posts: 147
ClassMetaData doesn't allow you to discover database specific detail.

You need to use the configuration object you used to build the session factory and do the following:

Code:
config.getClassMapping( Item.class ).getTable().getName()


Cheers.

Myk.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.