From: Jordan <jo...@re...> - 2007-03-21 05:25:45
|
As the Hibernate devs will often sarcastically remind you, the dev list = is NOT a user forum. Check hibernate.org for a link to the forums, where = people are more apt to help. That said, access to mapping information for a persistent class is = usually done through the SessionFactory. In Hibernate 2 one goes: SessionFactory factory =3D *YOUR SESSION FACTORY* Class cls =3D *YOUR PERSISTENT OBJECT CLASS* BasicEntityPersister classMetadata =3D = (BasicEntityPersister)factory.getClassMetadata(cls); Once you have access to classMetaData, you can get the table name = through: classMetadata.getTableName() -JL ----- Original Message -----=20 From: Hess Yvan=20 To: hib...@li...=20 Sent: Tuesday, March 20, 2007 3:46 AM Subject: [Hibernate] Getting mapped table name to a persistent object Hi, I am using Hibernate V 2.1.8, and I have to do a bulk update using a = direct SQL connection. This is due to the fact that Hibernate V2.1.8 = doesn't support Query.update(). As the database mapping table can change = into my Hibernate mapping, I would like to retrieve it dynamicly.=20 How can retrieve the name of the database table that is used to store = a given persisent object ? Thanks for your answer. Regards. Yvan Hess Yvan Hess Chief Software Architect e-mail: yva...@im... phone : +41 (0)26 460 66 66=20 fax : +41 (0)26 460 66 60=20 Informatique-MTF SA Route du Bleuet 1=20 CH-1762 Givisiez=20 Excellence in Compliance and Document Management http://www.imtf.com DISCLAIMER=20 This message is intended only for use by the person to whom it is = addressed. It may contain information that is privileged and = confidential. Its content does not constitute a formal commitment by = IMTF. If you are not the intended recipient of this message, kindly = notify the sender immediately and destroy this message. Thank You. -------------------------------------------------------------------------= ----- = -------------------------------------------------------------------------= Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to = share your opinions on IT & business topics through brief surveys-and earn cash = http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV -------------------------------------------------------------------------= ----- _______________________________________________ hibernate-devel mailing list hib...@li... https://lists.sourceforge.net/lists/listinfo/hibernate-devel |