使用SpringBoot做JAVA开发时,用Repository.save();保存数据的时候遇到了报错:

could not execute statement; SQL [n/a]; constraint [PRIMARY]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement

去搜索了一下解决方法,需要将主键设置自增,虽然不清楚为什么,但是将主键设置自增之后确实解决问题了,以后清楚原因之后再来补上。

SpringBoot保存数据报错:could not execute statement; SQL [n/a]; constraint [PRIMARY];nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement的更多相关文章

  1. org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.

    今天报了这个异常,这是页面报的 org.springframework.dao.DataIntegrityViolationException: could not execute statement ...

  2. 【hibernate】报错:org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.DataException: could not execute statement

    报错如下: org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a ...

  3. 报错:org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statement

    org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement; SQL [n ...

  4. HTTP Status 500 - Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement

    1.什么操作出现:当我在项目中添加产品或者修改时,浏览器出现HTTP Status 500 - Request processing failed; nested exception is org.h ...

  5. org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query

    原因: 这个问题的解决方案很简单,主要是因为数据库中不存在相关的表或者列. org.springframework.dao.InvalidDataAccessApiUsageException: Pa ...

  6. exception is org.hibernate.exception.DataException: Could not execute JDBC batch update at

    没有什么问题,但是却报了Could not execute JDBC batch update的错,主要是配置文件设置了关联,数据却没有关联造成的,只要数据正确就没有问题. 另外,造成这个原因的还可能 ...

  7. 报错org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet"

    org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n ...

  8. 【hibernate postgresql】注解@TypeDef/@Enumerated/数据库字段gender为枚举类型,从前台接受到实体后进行保存报错:org.postgresql.util.PSQLException: ERROR: column "gender" is of type gender but expression is of type character varying

    数据库字段gender为枚举类型,从前台接受到实体后进行保存报错:org.postgresql.util.PSQLException: ERROR: column "gender" ...

  9. 严重: Could not synchronize database state with session org.hibernate.exception.DataException: Could not execute JDBC batch update

    p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #ff2600 } p.p2 { margin: 0.0px 0 ...

随机推荐

  1. H5各种头部meta标签功能大全

    <!DOCTYPE html>  H5标准声明,使用 HTML5 doctype,不区分大小写 <head lang=”en”> 标准的 lang 属性写法 <meta ...

  2. Java实现 Cookie的生成与读取

    今天学习的时候发现Cookie挺有意思的,就自己网上找点例子,自己敲点代码熟练下,现在就记录下来,分享一下. 什么是cookie?? Cookie 是一小段文本信息,伴随着用户请求和页面在 Web 服 ...

  3. zabbix-自定义监控项

    一.自定义一个监控项 模板虽好,但是不能解决所有的监控,有些需要的监控项在模板中并没有,需要我们自己定义一个监控项,如何定义一个监控项呢?大概的流程是这样的几步 .在插件配置文件中定义一个key/va ...

  4. 浅谈JAVA继承关系中的构造函数

    话不多说直接上例子,我的例子中定义了两个类,TheSon和TheFather,TheSon继承了TheFather,如图: TheSon类的定义: ​ TheFather类的定义: 当我们初始化The ...

  5. TLS1.3&TLS1.2形式化分析(二)

    1.下面是TLS1.2和TLS1.3握手协议过程 ,明显的可以看出存在不同 . 我们先说TLS1.2的握手过程明显是比TLS1.3的握手过多了一次.在TLS1.3中舍弃了之前RSA的协商过程,然后基于 ...

  6. Django hrf:权限、频率控制

    一.权限 二.频率控制 一.权限 1.权限介绍 只有超级用户才能访问指定的数据,所以就要用权限组件进行设置 2.局部使用 # 单独抽出写一个视图类 from rest_framework.permis ...

  7. YOLO---YOLOv3 with OpenCV 再使用

    YOLO---YOLOv3 with OpenCV 再使用YOLOv3 with OpenCV官网 @ https://github.com/JackKoLing/opencv_deeplearnin ...

  8. BackGroundWorker组件使用、Winform控件的Invoke安全调用

    BackgroundWorker是·net里用来执行多线程任务的控件,它允许编程者在一个单独的线程上执行一些操作. 可以通过编程方式创建 BackgroundWorker,也可以将它从"工具 ...

  9. duilib学习领悟(3)

    世上本无窗口,窗口只是人的眼睛和电脑屏幕及鼠标键盘相互操作后的视觉效果! 下面我们来看看我们之前讲过的代码: class CDuiFrameWnd : public CWindowWnd, publi ...

  10. Pandas to_sql TypeError: sequence item 0: expected str instance, dict found

    问题介绍 打印了一下数据格式,并未发现问题.如果说是字典实例引起的. 我猜测也是extra字段引起的,因为extra字段是一个json字段.根据网上的提示要对这样的格式进行强转str. 其他发现:pd ...