简体   繁体   English

org.hibernate.criteria.uniqueResult期间的AssertionFailure

[英]org.hibernate.AssertionFailure during criteria.uniqueResult

I am selecting data from a table which is call pHistory, this table does not have any relationShip with CenterLog entity, however, I am still getting hibernate error complain that null id in CenterLog entity.我正在从一个名为 pHistory 的表中选择数据,该表与 CenterLog 实体没有任何关系,但是,我仍然收到 hibernate 错误,抱怨 CenterLog 实体中的 null id。

The log is as follow:日志如下:

org.hibernate.AssertionFailure: null id in com.audit.entity.CenterLog entry (don't flush the Session after an exception occurs)
    at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:78) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:187) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:143) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:58) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1589) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:328) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]

As my understanding, uniqueResult is not doing any save event, but not sure I am still hitting this.据我了解, uniqueResult 没有做任何保存事件,但不确定我是否仍在点击它。

The error message says (don't flush the Session after an exception occurs) : there was another exception earlier and it the cause of the problem.错误消息说(don't flush the Session after an exception occurs) :之前有另一个异常,它是问题的原因。

You need to find that other exception and fix it.您需要找到其他异常并修复它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有多个结果时使用休眠Criteria.uniqueResult() - using hibernate Criteria.uniqueResult() when there are several results org.hibernate.AssertionFailure: null 标识符@OneToOne 关系 - org.hibernate.AssertionFailure: null identifier @OneToOne relationship org.hibernate.AssertionFailure:可能对会话进行非线程安全的访问 - org.hibernate.AssertionFailure: possible non-threadsafe access to the session org.hibernate.AssertionFailure 获取序列值时的问题 - org.hibernate.AssertionFailure Issue when getting sequence value org.hibernate.AssertionFailure:集合被flush()处理了两次 - org.hibernate.AssertionFailure: collection was processed twice by flush() Criteria.uniqueResult返回null,但未引发任何错误 - Criteria.uniqueResult is returning null, but no error is thrown Hibernate:org.hibernate.AssertionFailure:com.xxx.Bean条目中的null id - Hibernate: org.hibernate.AssertionFailure: null id in com.xxx.Bean entry Spring JPA 共享主键导致 org.hibernate.AssertionFailure: null identifier - Spring JPA Shared primary key causes org.hibernate.AssertionFailure: null identifier 如何使用 criteria.uniqueResult(); 填充碧玉报告? - How to fill jasper report using criteria.uniqueResult();? Spring JPA/Hibernate org.hibernate.AssertionFailure: null id in Entity(异常发生后不刷新Session) - Spring JPA/Hibernate org.hibernate.AssertionFailure: null id in Entity (don't flush the Session after an exception occurs)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM