Atitit. automatically generate a database structure script or change the database, based on hibernate4, atitithibernate4

Source: Internet
Author: User

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

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.