How do we create new table apart from mapping with existing table ?

How do we create new table apart from mapping with existing table ?

Hi,

How do we create new table apart from mapping with existing table ?

Thanks,

View Answers

May 2, 2013 at 11:17 AM

Hi,

In Hibernate there is a feature that you can create a new table automatically, if you have corresponding POJOs. You have to write the code in you existing table utilizing the Hibernate. To create the POJO class for the new table to be create by defining the (new table name).hbm.xml file of the table and change the property "hbm2ddl.auto" value to "create" in the hibernate.dfg.xml file. Then you append the mapping resouce of the newTable in hibernate.cfg.xml.

This way you can create a new table using existing table in hibernate. Please visit this link http://www.roseindia.net/hibernate/

Thanks,









Related Tutorials/Questions & Answers:

Ads