1. 在myeclipse的右下角,updating indexes進(jìn)度條一直不會(huì)在進(jìn)行,鬧心。解決:在打開“windows”---“preferences”---“Myeclipse Enterprise Workbench”---“Maven4Myeclipse”后,把“Download repository index updates on startup”前面的勾去掉,apply,ok
2. 關(guān)于由hibernate自動(dòng)生成表結(jié)構(gòu)的配置(在applicationContext.xml中)
hibernate.hbm2ddl.auto有以下四種配置參數(shù):
validate:加載hibernate時(shí),驗(yàn)證創(chuàng)建數(shù)據(jù)庫表結(jié)構(gòu)
create:每次加載hibernate,重新創(chuàng)建數(shù)據(jù)庫表結(jié)構(gòu),這就是導(dǎo)致數(shù)據(jù)庫表數(shù)據(jù)丟失的原因
create-drop:加載hibernate時(shí)創(chuàng)建,退出是刪除表結(jié)構(gòu)
update:加載hibernate自動(dòng)更新數(shù)據(jù)庫結(jié)構(gòu)
所以,在創(chuàng)建表的時(shí)候,完全可以考慮自動(dòng)生成(create)或者不使用外鍵(update時(shí)產(chǎn)生)
2. 關(guān)于由hibernate自動(dòng)生成表結(jié)構(gòu)的配置(在applicationContext.xml中)
hibernate.hbm2ddl.auto有以下四種配置參數(shù):
validate:加載hibernate時(shí),驗(yàn)證創(chuàng)建數(shù)據(jù)庫表結(jié)構(gòu)
create:每次加載hibernate,重新創(chuàng)建數(shù)據(jù)庫表結(jié)構(gòu),這就是導(dǎo)致數(shù)據(jù)庫表數(shù)據(jù)丟失的原因
create-drop:加載hibernate時(shí)創(chuàng)建,退出是刪除表結(jié)構(gòu)
update:加載hibernate自動(dòng)更新數(shù)據(jù)庫結(jié)構(gòu)
所以,在創(chuàng)建表的時(shí)候,完全可以考慮自動(dòng)生成(create)或者不使用外鍵(update時(shí)產(chǎn)生)