提示表的标识符重复,发现是数据库中的主键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. vue-cli 3.0

    安装 vue-cli 3.0 时报错 vue-cli3安装遇到的问题,卸载不掉旧版本,导致更新不了 vue-cli 2.9.6 版本卸载不了 作者:Runner_leaf链接:https://www. ...

  2. uni-app图片压缩转base64位 利用递归来实现多张图片压缩

    //选择图片 chooseImage(){ let that =this uni.chooseImage({ sizeType: ['original','compressed'], //可以指定是原 ...

  3. Fiddler 抓包设置

    手机抓包设置 一:配置Fiddler参数 打开Fiddler菜单项Tools->TelerikFiddler Options->HTTPS, 勾选CaptureHTTPS CONNECTs ...

  4. Java Spring Boot VS .NetCore (十一)自定义标签 Java Tag Freemarker VS .NetCore Tag TagHelper

    Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Jav ...

  5. c++ explicit 构造函数

    代码 #include<iostream> using namespace std; class Example { private: int data; public: Example( ...

  6. .net core2.x - 关于仓储(Repository)

    概要:在搭建框架,顺手说下写下,关于Repository,可能你理解了,可能你还不理解,可能与不可能不是重点,重点是感兴趣就看看吧. 1.仓储(Repository)是什么? 看下翻译:仓库; 贮藏室 ...

  7. mq_receive

    NAME mq_receive - 从消息队列中获取消息 (REALTIME) SYNOPSIS #include <mqueue.h> ssize_t mq_receive(mqd_t ...

  8. Round#534 div.2-B Game with string

    唔,第一次参加,掉了好多分. http://codeforces.com/contest/1104/problem/B 不用考虑太多,string真的好厉害. #include<stdio.h& ...

  9. Linux 下执行本目录的可执行文件(命令)为什么需要在文件名前加“./”

    一.PATH 是环境变量,里面保存了执行文件路径(通常会包含多个路径,各路径之间以冒号":"进行间隔).当执行一个可执行文件(命令)时,Linux 会优先到 PATH 环境变量中保 ...

  10. 【Codeforces】【网络流】【线段树】【扫描线】Oleg and chess (CodeForces - 793G)

    题意: 给定一个n*n的矩阵,一个格子上可以放一个车.其中有q个子矩阵,且q个子矩阵互不相交或者是重叠(但边界可以衔接).这q个子矩阵所覆盖的地方都是不能够放车的.车可以越过子矩阵覆盖的地方进行攻击( ...