提示表的标识符重复,发现是数据库中的主键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. 【原创】Linux基础之常用命令

    1 磁盘.cpu.内存相关 查看全部设备信息 # lspci 查看整体磁盘空间占用情况 # df -h 查看整体磁盘inode占用情况 # df -i 查看文件详细信息 # ls -l $path 查 ...

  2. 【原创】大叔经验分享(12)如何程序化kill提交到spark thrift上的sql

    spark 2.1.1 hive正在执行中的sql可以很容易的中止,因为可以从console输出中拿到当前在yarn上的application id,然后就可以kill任务, WARNING: Hiv ...

  3. storage和memory

    memory:使用的是值传递,默认使用的是memory,传递的是值 storage:引用传递,传过来的是指针,后面一定要加上internal,private pragma solidity ^; co ...

  4. JavaScript入门学习笔记(JSON)

    JSON是JavaScript Object Notation的简称,是一种轻量级的数据交换格式. JSON使用JS的语法,但其格式只是一个文本,可以被任何编程语言读取病作为数据格式传递. JSON以 ...

  5. 分布式Session共享解决方案

    分布式Session解决方案 Author:SimpleWu 分布式Session一致性? 说白了就是服务器集群Session共享的问题 Session的作用? Session 是客户端与服务器通讯会 ...

  6. bootstrap-datetimepicker的中文显示问题

    bootstrap-datetimepicker的本地化显示依赖于moment插件.也就是说moment插件提供了多语言的内容支持,而bootstrap-datetimepicker没有语言内容. 为 ...

  7. Concept of function continuity in topology

    Understanding of continuity definition in topology When we learn calculus in university as freshmen, ...

  8. [转]安装v2ray,部署手机电脑***

    https://www.coding996.com/digitalocean-build-v2ray-0-1/https://blog.verkey.org/209.html 环境信息 服务器系统:C ...

  9. c&c++中的宏

    1 c&c++中的宏 do {...} while (0); offsetof & container_of 2 引用 [1] do {...} while (0) 在宏定义中的作用 ...

  10. rabbitmq-cluster搭建

    一.前期准备: 准备3台linux系统,配置好公司源,或者官网下载相应的网络源 1.条件:准备3台linux系统,确保能连到download.yunwei.edu 2.编写yum源下载脚本: #vim ...