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]

  • 相关阅读:
    Linux记录-批量安装zabbix(转载)
    k8s-基础环境配置(六)
    k8s记录-ntpd时间同步配置(五)
    k8s记录-flanneld+docker网络部署(四)
    Java面试通关要点汇总集
    Java并发编程系列
    码农需要知道的“潜规则”
    领域驱动设计文章
    自动化测试的一些思考
    轻量级爬虫框架
  • 原文地址:https://www.cnblogs.com/weipeng/p/2587459.html
Copyright © 2011-2022 走看看