zoukankan      html  css  js  c++  java
  • 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]

  • 相关阅读:
    Cassandra的数据模型
    数组中只出现一次的数
    MyBatis总结
    Java线程池的使用
    Fork/Join框架详解
    WWW
    DNS远程和DNS日志
    [DNS]ACL、also-notify、视图服务器及安全设置
    Linux入门进阶第六天——登录文件、开机与模块管理
    Linux入门进阶第四天——服务管理
  • 原文地址:https://www.cnblogs.com/weipeng/p/2587459.html
Copyright © 2011-2022 走看看