org.hibernate.AssertionFailure: null id in xxx.xx.xx的问题
- org.hibernate.AssertionFailure: null id in com.aa.TShoucang
null id,这个是什么回事呢?数据库是自动增长了,hibernate映射文件也一切正常的了,看了后台也打印出了insert into ....这个的语句了,但为什么就是插入不成功呢?
本着知之为知之,不知google之的精神,google了一下,都是说数据库与映射文件不对应,数据库设置了不为null,但hibernate里的映身文件设置了为null等等的.
发现都不是这个的问题,后来直接将打印出来的sql语句发送到数据库里执行一下,也是报一样的错,也就是说与hibernte没关系了.如以下这一句:
- insert into t_shoucang (url, describe, objic, userid, createuserid, createusername, createtime, updatetime, id) values ('aa', 'bb', 'cc', 'dd', 'ee', 'ff', '2010-01-01', '2010-01-01', 'abcd123');
发现describe这个字段变成了蓝色,是关键字,加多一个s后,再运行,OK了.
所以总结得出,null id这个问题时,有可能是字段里用到了数据库的关键字了.
今日又再出现这个问题了,并不是数据库关键字的原因了,如果数据库里设置了某个字段值不为null,而你保存的时候就设置了为null,也会报这个异常的。郁闷....
org.hibernate.AssertionFailure: null id in xxx.xx.xx的问题的更多相关文章
- org.hibernate.AssertionFailure: null id in xxx entry (don't flush the Session after an exception occurs)
网上找了很久,发现造成原因有很多种,后来终于发现了端倪:看提示是发生了异常,查看业务代码,发现有这个逻辑:先插入记录,如果有唯一键约束异常(并发造成),catch时查询已存在的记录,查询的时候就报了此 ...
- 报错:org.hibernate.AssertionFailure: null id in com.tt.hibernate.entities.News entry (don't flush the Session after an exception occurs)
在使用hibernate创建数据库的表格时,出现了如下报错: 十二月 28, 2016 10:17:02 上午 org.hibernate.tool.hbm2ddl.SchemaExport perf ...
- org.hibernate.AssertionFailure: null id in com.you.model.User entry (don't flush the Session after a
1.错误描写叙述 org.hibernate.AssertionFailure: null id in com.you.model.User entry (don't flush the Sessio ...
- org.hibernate.AssertionFailure: null id don't flus
我的是字段编码和数据库不匹配,是爬的微博数据
- org.hibernate.AssertionFailure: null id 错误
对象属性有Blob类型: 而Blob需在输入流中读取: InputStream in = new FileInputStream(url.getFile()); Blob bookPic = lobH ...
- null id in com.rocky.** entry 错误处理
1. 概述 使用hibernate往mysql数据库插入记录出错如下 10:37:57,364 ERROR [AssertionFailure] an assertion failure occure ...
- null id in entry (don't flush the Session after an exception occurs)
null id in entry (don't flush the Session after an exception occurs) 遇到这个异常实属不小心所致,最初看到异出的错误信息时我误认为是 ...
- org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.chen.vo.Dept.parentId
异常描述:执行以下的addAsHaveParentId2方法出现此异常: /*-----------------------类Dept.Dept.hbm.xml有parentId属性(数据库中有此列) ...
- org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.trs.om.bean.User.retryCount
六月 29, 2019 5:42:45 下午 org.apache.catalina.core.AprLifecycleListener init信息: The APR based Apache To ...
随机推荐
- SerializeHelper
using System; using System.Collections.Generic; using System.Configuration; using System.IO; using S ...
- mysql中min和max查询优化
mysql max() 函数的需扫描where条件过滤后的所有行: 在测试环境中重现: 测试版本:Server version: 5.1.58-log MySQL Community ...
- KVM CPU线程等学习记录
绝大多数操作系统调度单位是线程.线程是调度和分配的基本单位,进程是资源拥有的基本单位.linux下fork的叫进程pthread叫线程创建进程比线程性能要差好多5-100倍,因进程不同而异.进程之间共 ...
- jenkins2.0以后的版本提供自动部署和远程部署功能?
metting result comment: 持续集成:dev上使用 持续部署:在dev/uat/prod上使用 1.指定时间自动构建--发布第二天挂了?每次构建需要重新编译?qa和uat使用同一套 ...
- mysql之pymsql的使用
# -*- coding:utf-8 -*- import pymysql user = input('请输入用户名:') pwd = input('请输入密码:') # 1.连接 conn = py ...
- android 开发 实现一个app的引导查看页面(使用ViewPager组件)
我们安装完app后第一次打开app,通常都会有一个翻页图片形式的app引导简介说明.下面我们来实现这个功能.ViewPager这个组件与ListView和RecyclerView在使用上有很高的相似处 ...
- layer.js关闭子窗口及刷新父窗口
在需要layer.js弹窗口时,当编辑完窗口内容,需要关闭及刷新父窗口时: $("#senddata").click(function(){var id = $('input[na ...
- 非阻塞套接字编程, IO多路复用(epoll)
非阻塞套接字编程: server端 import socket server = socket.socket() server.setblocking(False) server.bind(('', ...
- <Linux> 文件夹右下角有锁,解锁
sudo chown -R $USER 文件夹路径 例如:sudo chown -R $USER ~/scala
- Java-1.6-并发包-集合
List相关 对于List并发包就只扩展了一个CopyOnWriteArrayList<E> Set相关 对于Set,并发包扩展ConcurrentSkipListSet<E> ...