提示表的标识符重复,发现是数据库中的主键id重复了。因为是序列自动生成的。

我原本以为是因为我的序列的问题,序列.nextval()有问题,但是当我在数据库测试时,发现当前序列没有问题。但是当数据插入时,id的值却和数据库不一致。于是我打印了sql语句,发现插入时,select hibernate_sequence.nextval from dual是这个序列的值,而不是我自己定义的。这个是默认的序列

这是因为我们在配置hibernate配置文件时,没有指定序列名。

改为:

解决问题!

org.hibernate.HibernateException: Duplicate identifier in table for: Waa的更多相关文章

  1. 解决org.hibernate.HibernateException: identifier of an instance of com.ahd.entity.Order was altered from2 to 0

    错误信息 严重: Servlet.service() for servlet [springmvc] in context with path [/order] threw exception [Re ...

  2. Caused by: org.hibernate.HibernateException: identifier of an instance of ... is alterde from

    Caused by: org.hibernate.HibernateException: identifier of an instance of ... is alterde from     Hi ...

  3. 【hibernate】错误:org.hibernate.HibernateException: identifier of an instance of com.agen.entity.Monthdetail was altered from xx to xx

    所报错误: org.hibernate.HibernateException: identifier of an instance of com.agen.entity.Monthdetail was ...

  4. identifier of an instance of xx.entity was altered from xxKey@249e3cb2 to xxKey@74e8f4a3; nested exception is org.hibernate.HibernateException: identifier of an instance of xxentity was altered from错误

    用entityManager保存数据时报错如下 identifier of an instance of xx.entity was altered from xxKey@249e3cb2 to xx ...

  5. Atitit.解决org.hibernate.DuplicateMappingException: Duplicate class/entity mapping

    Atitit.解决org.hibernate.DuplicateMappingException: Duplicate class/entity mapping 1. 排除流程::: @Depreca ...

  6. spring整合hibernate的时候报异常org.hibernate.HibernateException: createQuery is not valid without active transaction

    在整合Spring4+hibernate4时候,当代码执行到dao中CRUD操作时,报了一个异常, org.hibernate.HibernateException: createQuery is n ...

  7. org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here

    org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not a ...

  8. org.hibernate.HibernateException: No Session found for current thread

    spring.springmvc和hibernate整合 在sessionFactory.getCurrentSession()时,出现以下异常 No Session found for curren ...

  9. org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance:

    详细错误堆栈信息: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" ...

随机推荐

  1. 《剑指offer》整数中1出现的次数

    本题来自<剑指offer> 反转链表 题目: 思路: C++ Code: Python Code: 总结:

  2. An overview of network penetration testing

    1. an SQLi vulnerability will allow you  to do the  following query the database using select statem ...

  3. [转] 微信小程序之生命周期

    本篇文章介绍小程序的生命周期,由于小程序分为应用和页面两个部分,所以小程序的生命周期就涉及到三个部分,分别是: 应用的生命周期 页面的生命周期 应用的生命周期对页面生命周期的影响 一.应用的生命周期 ...

  4. RxJS操作符(二)

    一.Observable的性质 三种状态:nex, error, complete 进入到Error状态: ) .filter(val=>{ throw '出错了' }) .take() .re ...

  5. ubuntu chrome 无法从该网站添加应用,拓展程序或脚本

    昨天装好ubuntu 18.04 lts版本后,下载了chrome( 版本 68.0.3440.106)和SwitchyOmega,本来计划离线安装,结果提示“无法添加来自此网站的应用.扩展程序和应用 ...

  6. 1、python基础

    本节主要内容 语言特性 变量 注释 字符串拼接 循环 数据类型与字符编码 三元运算 进制 一 .语言特性 python是一门动态解释性的强类型定义语言. 1.编译和解释语言: 简单讲,编译(compl ...

  7. Linux-父子进程的简单同步

    int fork() 功能:创建一个子进程 返回值:0-创建成功,-1-创建进程失败,>0-创建进程成功,返回返回子进程id int wait(int * status) 功能:将调用的进程挂起 ...

  8. C# 接口属性的定义&get、set访问器的简单应用

    using System; using System.Collections.Generic; using System.Linq; using System.Text;   namespace 接口 ...

  9. C# 集合已修改 可能无法执行枚举操作 zz

    今天编写程序时 修改了list集合 在foreach时报 “集合已修改:可能无法执行枚举操作.”错误. 首先想到的是没有锁定集合对象. 增加了 private readonly object sync ...

  10. django——视图层

    1. 视图函数 一个视图函数,简称视图,是一个简单的Python 函数,它接受Web请求并且返回Web响应.响应可以是一张网页的HTML内容,一个重定向,一个404错误,一个XML文档,或者一张图片. ...