This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate 2: net.sf.hibernate.HibernateException: You may not dereference a collection with cascade=  RSS feed

 
John Landon
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting net.sf.hibernate.HibernateException: You may not dereference a collection with cascade="all-delete-orphan"
All I am doing is running a select query:

"from Book book item where book.read= false order by item.writtenDate desc"

It does not make any sense...

Please help.

Thanks,
John.

PS.
Here is the full stack trace
1.1 net.sf.hibernate.HibernateException: You may not dereference a collection with cascade="all-delete-orphan"net.sf.hibernate.HibernateException: You may not dereference a collection with cascade="all-delete-orphan"
at net.sf.hibernate.impl.SessionImpl.updateUnreachableCollection(SessionImpl.java:2951)
at net.sf.hibernate.impl.SessionImpl.flushCollections(SessionImpl.java:2816)
Exception in thread "main"
at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2282)

at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1815)
1 com.booker.exceptions.BookerException: Error quering
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1578)
1.1 net.sf.hibernate.HibernateException: You may not dereference a collection with cascade="all-delete-orphan"net.sf.hibernate.HibernateException: You may not dereference a collection with cascade="all-delete-orphan"
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1543)
at net.sf.hibernate.impl.SessionImpl.updateUnreachableCollection(SessionImpl.java:2951)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:49)
at net.sf.hibernate.impl.SessionImpl.flushCollections(SessionImpl.java:2816)
:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!