How do i remove/undo .SetMaxResults(n) / .SetFirstResult(n) from a nHibernate criteria query? -


is there way remove/undo .setmaxresults() / .setfirstresults() constructed detachedcriteria?

can done without changing original detachedcriteria?

yes can remove/undo setting value "-1", nhibernate internally uses static value nhibernate.engine.rowselection.novalue

criteria.setmaxresults(nhibernate.engine.rowselection.novalue); criteria.setfirstresult(nhibernate.engine.rowselection.novalue); 

if want keep original detachedcriteria need create clone before changing .setmaxresults / .setfirstresult

 detachedcriteria clonedcriteria = nhibernate.criteriatransformer.clone(originalcriteria)                  .setmaxresults(nhibernate.engine.rowselection.novalue)                  .setfirstresult(nhibernate.engine.rowselection.novalue); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -