最近遇到一個(gè)比較少見(jiàn)的異常情況:
異常情況:Exception in thread "main" org.hibernate.exception.ConstraintViolationException: could not insert: [org.apple.bsm.vo.books]
原因:由于建表時(shí)候 id generator,插入數(shù)據(jù)的時(shí)候由于原來(lái)id設(shè)計(jì)是自動(dòng)增長(zhǎng)的,所以會(huì)發(fā)生異常。
解決辦法:用mysql的GUI管理工具把generatror 改為increment
-------------------------------------------------------------------------------------------------
PS:本博客文章,如果沒(méi)有注明是有“轉(zhuǎn)”字樣,屬于本人原創(chuàng)。如果需要轉(zhuǎn)載,務(wù)必注明作者和文章的詳細(xì)出處地址,否則不允許轉(zhuǎn)載,多謝合作!
posted on 2008-01-21 10:39
apple0668 閱讀(5243)
評(píng)論(2) 編輯 收藏 所屬分類:
hibernate