org.hibernate.HibernateException: Duplicate identifier in table for: Waa
提示表的标识符重复,发现是数据库中的主键id重复了。因为是序列自动生成的。
我原本以为是因为我的序列的问题,序列.nextval()有问题,但是当我在数据库测试时,发现当前序列没有问题。但是当数据插入时,id的值却和数据库不一致。于是我打印了sql语句,发现插入时,select hibernate_sequence.nextval from dual是这个序列的值,而不是我自己定义的。这个是默认的序列
这是因为我们在配置hibernate配置文件时,没有指定序列名。

改为:

解决问题!
org.hibernate.HibernateException: Duplicate identifier in table for: Waa的更多相关文章
- 解决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 ...
- 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 ...
- 【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 ...
- 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 ...
- Atitit.解决org.hibernate.DuplicateMappingException: Duplicate class/entity mapping
Atitit.解决org.hibernate.DuplicateMappingException: Duplicate class/entity mapping 1. 排除流程::: @Depreca ...
- spring整合hibernate的时候报异常org.hibernate.HibernateException: createQuery is not valid without active transaction
在整合Spring4+hibernate4时候,当代码执行到dao中CRUD操作时,报了一个异常, org.hibernate.HibernateException: createQuery is n ...
- 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 ...
- org.hibernate.HibernateException: No Session found for current thread
spring.springmvc和hibernate整合 在sessionFactory.getCurrentSession()时,出现以下异常 No Session found for curren ...
- 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" ...
随机推荐
- es2015 解构赋值
解构赋值语法是一个 Javascript 表达式,这使得可以将值从数组或属性从对象提取到不同的变量中.
- Java的家庭记账本程序(G)
日期:2019.2.24 博客期:035 星期日 啊哈!记账本虽然还是没有做完,不过,今天我的工作量应该是足够的!哦!差点忘记说啦!我是在Android Studio出现了问题之后,跑去研究微信小程序 ...
- Team Queue (HDU:1387)
Queues and Priority Queues are data structures which are known to most computer scientists. The Team ...
- 用什么方法给PDF添加页眉页脚
我们所看到的书本中都会设置好有页眉页脚,那么电子书想要添加页眉页脚要怎么操作呢,用什么方法可以在PDF中添加页眉页脚呢,今天就为大家分享一下,如何在电子文件中添加页眉页脚,想知道的小伙伴们就一起来看看 ...
- Java Spring Boot VS .NetCore (五)MyBatis vs EFCore
Java Spring Boot VS .NetCore (一)来一个简单的 Hello World Java Spring Boot VS .NetCore (二)实现一个过滤器Filter Jav ...
- log4j2使用入门(一)
log4j2是log4j的一个升级版,与log4j1相比进行了很大的改善,同时也修复了一些logback的架构上的问题.所以是目前应用开发的首选的日志器(下载位置:http://apache.faye ...
- Laravel日常使用总结
字段当做键值key 集合的keyBy()方法详情:戳这里 创建模型类和数据库迁移文件 php artisan make:model Post -m 创建控制器和基础的方法 php artisan ma ...
- 解决Mysql命令行输入密码闪退问题
输入密码闪退是因为后台Mysql服务没有启动. 解决办法:我的电脑,右键管理,服务,查看服务里面Mysql是否在运行.如果没有在运行那么可以右键启动,最好属性中设置为自动启动.
- event.target 和 event.currentTarget 的区别
event.target This property of event objects is the object the event was dispatched on. It is differe ...
- Android系统层次解析
目标:从宏观上解释Android整个系统结构 来源: <Android4高级编程> 目录: 1. Android软件栈结构 一.Android软件栈结构 Android软件栈分为四个结构: ...