-->
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.  [ 3 posts ] 
Author Message
 Post subject: Getting tablename of a mapped entity (Promise good rating:-)
PostPosted: Tue Oct 24, 2006 5:17 am 
Newbie

Joined: Mon Jul 03, 2006 1:14 am
Posts: 6
Location: Bangalore, India
Hibernate version:3.0

Mapping documents:
The mapping document for my persistent class goes like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="india.bsnl.data.nib2.project3.portal.bo.BOAddressInfo" table="tblwp_addressinfo">
<id name="ADDRESSID" column="ADDRESSOID" unsaved-value="0">
<generator class="sequence">
<param name="sequence">SEQ_ADDRESS</param>
</generator>
</id>
<version name="RECORD_VERSION" column="RECORD_VERSION"/>
<property name="ADDRESS_TYPE" type="int" column="ADDRESSTYPE"/>
<property name="ADDRESS_LINE1" type="string" column="ADDRESSLINE1"/>
...

Name and version of the database you are using: Oracle9i

The problem at hand:
I need to get programmatically the table name to which the persistent class is mapped. Is there any in-built method in the Hibernate API using which I can obtain the table name corresponding to a class, or is there any other method to do the same. Please let me know, and win ratings :-).

Thanks in advance.

Regards, Gopal.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 24, 2006 5:28 am 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
I think this should answer your question:

http://www.hibernate.org/118.html#A19

_________________
Please don't forget to rate


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Tue Oct 24, 2006 6:12 am 
Newbie

Joined: Mon Jul 03, 2006 1:14 am
Posts: 6
Location: Bangalore, India
Thanks dude.. that was a quick reply. Done the rating :-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.