org.hibernate.exception.ConstraintViolationException


org.hibernate.exception.ConstraintViolationException
 

今天遇到這個錯誤,網上查了下,大多說是有必填字段沒有填,搞了很久沒搞定,最后發現不是因為這個問題,而是因為字段設置了唯一值,如果表中已存在此記錄,再插入則報此錯誤。

Hibernate: insert into membership.t_user (login_id, password, type, status, email, mobile, first_name, last_name, nickname, gender, birthday, country, region, creation_date, last_update_date, join_confirm_date, activation_date, deactivation_date, register_code, join_expire_date) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
org.springframework.dao.DataIntegrityViolationException: could not insert: [com.igen6.sac.ms.bean.TUser]; SQL [insert into membership.t_user (login_id, password, type, status, email, mobile, first_name, last_name, nickname, gender, birthday, country, region, creation_date, last_update_date, join_confirm_date, activation_date, deactivation_date, register_code, join_expire_date) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [com.igen6.sac.ms.bean.TUser]


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM