Hi all,
A simple question: is it possible to make the results returned from Criteria read-only (i.e., with dirty-checking disabled)?
I'm using Hibernate 3.2 and my Criteria query returns a large number of results which won't be modified but only displayed to the user. I want to tell Hibernate not to create snapshots of all these results for dirty checking. There is a setReadOnly method on the Query interface to achieve just this, but there is no such method on the Criteria interface.
The funny thing is that Java Persistence with Hibernate, 2007 edition, gives an example of using the seemingly unexistent method on page 624..
My Criteria is rather complex, constructed programmatically, so I don't want to use HQL.
Thanks for any hints!
|