I am getting a similar exception when running a query with scalar value:
We are using Hibernate 4.2.10.Final with Oracle
: java.lang.NullPointerException: null
at org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:153) ~[hibernate-core-4.2.10.Final.jar:4.2.10.Final]
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:89) ~[hibernate-core-4.2.10.Final.jar:4.2.10.Final]
at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:61) ~[hibernate-core-4.2.10.Final.jar:4.2.10.Final]
at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1130) ~[hibernate-core-4.2.10.Final.jar:4.2.10.Final]
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1187) ~[hibernate-core-4.2.10.Final.jar:4.2.10.Final]
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) ~[hibernate-core-4.2.10.Final.jar:4.2.10.Final]
at org.hibernate.internal.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:909) ~[hibernate-core-4.2.10.Final.jar:4.2.10.Final]
I am running an hql named query like this:
select count(*) from user u inner join u.roles as r inner join r.permissions as p where u = :user and p.name = :permission
|