atitit.自動產生資料庫結構指令碼,或者更換資料庫,基於hibernate4,atitithibernate4
atitit.自動產生資料庫結構指令碼,或者更換資料庫,基於hibernate4
目前近況::
更換資料庫,但是是使用spring整合的。
<!-- hibernate設定檔路徑 -->
<property name="mappingDirectoryLocations">
<!-- classpath -->
<value>classpath:/hbm</value>
</property>
怕是不能使用hbm2ddl cfg....走單獨的添加個hb cfg,測試添加給掛走ok..
作者:: 老哇的爪子 Attilax 艾龍, EMAIL:1466519819@qq.com
轉載請註明來源: http://blog.csdn.net/attilax
/wechatAdmin4propt/src/hibernate.cfg4geneDb.xml
刪除多疑的hbm檔案,開啟使用notepad, 刪除多行。。Myeclipse不能刪除多行。。
但是可以增加多行。。選中hbm檔案夾。。
<property name="hibernate.hbm2ddl.auto" >update</property>
/wechatAdmin4propt/src/com/attilax/hb/HibernateSessionFactory4geneDb.java
指向cfg.xml
測試指令碼
*/
public class geneDB {
/**
@author attilax 老哇的爪子
@since p2k k_l_v
*/
public static void main(String[] args) {
Session s=HibernateSessionFactory4geneDb.getSession();
s.merge(new Object());
System.out.println("---");
}
走ok