Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Hibernate How do we create new table apart from mapping with existing table ?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
How do we create new table apart from mapping with existing table ?
1 Answer(s)      a year and 5 months ago
Posted in : Hibernate


Hi,

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

Thanks,


Advertisement
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:
 

 

 

DMCA.com