• 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]

  • 相关阅读:
    支付系统
    在Ubuntu 14.04 64bit上安装百度云Linux客户端BCloud
    spring data jpa update
    多数据源springboot-jta-atomikos
    rabbitMQ 的基本知识
    java 调用短信 api 接口发送短信
    springboot整合ribbitMQ
    【RabbitMQ】ubuntu下RabbitMQ安装与简单使用
    @Slf4j注解
    quartz 定时任务的增删改
  • 原文地址:https://www.cnblogs.com/weipeng/p/2587459.html
Copyright © 2020-2023  润新知