On 11 Dec 2011, at 9:01 PM, Thomas Fox wrote: > I propose to change the semantics of the Criteria.add() and Criteria.or() > methods. > > In my opinion, both behave counter-intuitively. My opinion of an intuitive > behaviour would be: > - Criteria.or(someCondition) should result in a where clause which contains > ((whatever was in the where condition before) OR someCondition) > - Criteria.add(someCondition) should result in a where clause which > contains ((whatever was in the where condition before) AND someCondition), > i.e. the same as Criteria.and(someCondition) > > Instead, the behaviour is now > - Criteria.or(someCondition) only or's the new condition with any existing > condition(s) that affects the same column. > - Criteria.add(someCondition) replaces any existing condition(s) that > affects the same column with the new condition. > > I propose to change the behaviour of the Criteria.add() and Criteria.or() > methods to the intuitive behaviour stated above in Torque 4. (I have seen > to many bugs at $work resulting from the counter-intuitive behaviour). > Any objections ?
+1. This has confused me in the past, simpler is better. Is there any possibility of supporting nested queries? Something like Criteria.add(someNestedCriteria). Regards, Graham -- --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
