Suppose the user wants to use a DetachedCriteria to perform multiple queries (sligtly different) usign the executable criteria.
in this example:
Code:
DetachedCriteria dc = DetachedCriteria.fromClass(someclass);
// first use
Criteria c = dc.getExecutableCrietria(sess);
c.add(somerestrictions);
c.list();
// later, second use
Criteria c = dc.getExecutableCriteria(sess);
c.add(someotherrestrictions);
c.list();
The problem is that at the end of the first use the detached criteria is changed and alters the second use havign already added somerestricitons from first use. Why does the runtime criteria alters the detached crteria ?
Regards,