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