hibernate錯(cuò)誤
錯(cuò)誤1.
Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/workspace/MLDN2/WebRoot/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
把hibernate里的ehcache.xml拷貝到src目錄下,hibernate3用到了ehcache
錯(cuò)誤2.
在使用hql進(jìn)行操作的時(shí)候,表名要和類名一致,否則會(huì)出現(xiàn)table is not mapping的錯(cuò)誤
錯(cuò)誤3.
database product name cannot be null 是因?yàn)樵诘玫絚onfig的時(shí)候沒有在后面加.config()造成的
Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update?? 因?yàn)镠ibernate Tools(或者Eclipse本身的Database Explorer)生成*.hbn.xml工具中包含有catalog="***"(*表示數(shù)據(jù)庫(kù)名稱)這樣的屬性,將該屬性刪除就可以了
使用hql語(yǔ)句的時(shí)候,在select n.content from Newsvo? n where n.id=?的問(wèn)號(hào)的位置是從0開始記數(shù)的.
錯(cuò)誤4.
在使用Hibernate中,is not mapped 是hql語(yǔ)句中的表名首字母要大寫
No value specified for parameter錯(cuò)誤的原因少了pstmt.setInt(1, id);
錯(cuò)誤5.
用hibernate自動(dòng)生成的save方法,進(jìn)行保存的時(shí)候,報(bào)了org.hibernate.exception.SQLGrammarException: could not insert table: 發(fā)現(xiàn)是因?yàn)楸碇袆?chuàng)建了與關(guān)鍵字相同的字段group,修改之后就可以進(jìn)行插入操作
[img][/img]
錯(cuò)誤1.
Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/workspace/MLDN2/WebRoot/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
把hibernate里的ehcache.xml拷貝到src目錄下,hibernate3用到了ehcache
錯(cuò)誤2.
在使用hql進(jìn)行操作的時(shí)候,表名要和類名一致,否則會(huì)出現(xiàn)table is not mapping的錯(cuò)誤
錯(cuò)誤3.
database product name cannot be null 是因?yàn)樵诘玫絚onfig的時(shí)候沒有在后面加.config()造成的
Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update?? 因?yàn)镠ibernate Tools(或者Eclipse本身的Database Explorer)生成*.hbn.xml工具中包含有catalog="***"(*表示數(shù)據(jù)庫(kù)名稱)這樣的屬性,將該屬性刪除就可以了
使用hql語(yǔ)句的時(shí)候,在select n.content from Newsvo? n where n.id=?的問(wèn)號(hào)的位置是從0開始記數(shù)的.
錯(cuò)誤4.
在使用Hibernate中,is not mapped 是hql語(yǔ)句中的表名首字母要大寫
No value specified for parameter錯(cuò)誤的原因少了pstmt.setInt(1, id);
錯(cuò)誤5.
用hibernate自動(dòng)生成的save方法,進(jìn)行保存的時(shí)候,報(bào)了org.hibernate.exception.SQLGrammarException: could not insert table: 發(fā)現(xiàn)是因?yàn)楸碇袆?chuàng)建了與關(guān)鍵字相同的字段group,修改之后就可以進(jìn)行插入操作
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元
