Atitit. automatically generate a database structure script or change the database, based on hibernate4, atitithibernate4
Atitit. automatically generate the database structure script or change the database, based on hibernate4
Current situation ::
Change the database, but use spring integration.
<! -- Hibernate configuration file path -->
<Property name = "mappingDirectoryLocations">
<! -- Classpath -->
<Value> classpath:/hbm </value>
</Property>
Even if you cannot use hbm2ddl cfg... add an hb cfg separately and test the add to hanging OK ..
Author: old wow's paw Attilax iron, EMAIL: 1466519819@qq.com
Reprinted please indicate Source: http://blog.csdn.net/attilax
/WechatAdmin4propt/src/hibernate. ipv4genedb. xml
Delete suspicious hbm files, open notepad, and delete multiple rows .. Myeclipse cannot delete multiple rows ..
But multiple rows can be added .. Select the hbm folder ..
<Property name = "hibernate. hbm2ddl. auto"> update </property>
/WechatAdmin4propt/src/com/attilax/hb/HibernateSessionFactory4geneDb. java
Point to cfg. xml
Test script
*/
Public class geneDB {
/**
@ Author attilax old wow's paw
@ Since p2k k_l_v
*/
Public static void main (String [] args ){
Session s = HibernateSessionFactory4geneDb. getSession ();
S. merge (new Object ());
System. out. println ("---");
}
Go to OK