日期:2014-05-17  浏览次数:20763 次

hibernate异常(问题很急,小女子在此谢过大家了。)
问题很急,小女子在此谢过大家了。
问题描述:
数据成功插入数据库,但程序抛了如下异常。
数据库:sql server2000 其中主键是:uniqueidentifiler
下面要报错信息:
Hibernate: insert into bom_parent (BomId, ParentId, ParentScrap, SharingPartId) values (?, ?, ?, ?)
三月 06, 2014 11:25:28 上午 org.hibernate.AssertionFailure <init>
严重: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: null identifier
at org.hibernate.engine.EntityKey.<init>(EntityKey.java:39)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:302)
------解决方案--------------------
主键的问题
你自己看看
------解决方案--------------------
org.hibernate.AssertionFailure: null identifier
主键为空了!妹子好好找找!

------解决方案--------------------
看到了你的错误犹如天书
------解决方案--------------------
引用:
可是亲们,又遇到了一个异常:
三月 06, 2014 1:11:20 下午 org.hibernate.util.JDBCExceptionReporter logExceptions
警告: SQL Error: 544, SQLState: 23000
三月 06, 2014 1:11:20 下午 org.hibernate.util.JDBCExceptionReporter logExceptions
严重: 当 IDENTITY_INSERT 设置为 OFF 时,不能向表 'bom_opcomponent' 中的标识列插入显式值。
三月 06, 2014 1:11:20 下午 org.hibernate.event.def.AbstractFlushingEventListener performExecutions
严重: Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: could not insert: [cn.geeya.boss.MMS.po.MmsBomOpcomponentYy]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2267)
不都是spring自动生成的吗?你咋搞成这样了?配置,操作有没有问题?好好检查一下,特别是字段和熟悉有没有对应,还有大小写的问题!
------解决方案--------------------
来晚了。。。求个参与分
------解决方案--------------------
飘过~~看到hibernate就进来看一眼
------解决方案--------------------
引用:
Quote: 引用:

Quote: 引用:

可是亲们,又遇到了一个异常:
三月 06, 2014 1:11:20 下午 org.hibernate.util.JDBCExceptionReporter logExceptions
警告: SQL Error: 544, SQLState: 23000
三月 06, 2014 1:11:20 下午 org.hibernate.util.JDBCExceptionReporter logExceptions
严重: 当 IDENTITY_INSERT 设置为 OFF 时,不能向表 'bom_opcomponent' 中的标识列插入显式值。
三月 06, 2014 1:11:20 下午 org.hibernate.event