db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fox (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TORQUE-178) Change semantics of add() and or() methods in Criteria
Date Sun, 15 Jan 2012 14:00:39 GMT

    [ https://issues.apache.org/jira/browse/TORQUE-178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186512#comment-13186512
] 

Thomas Fox commented on TORQUE-178:
-----------------------------------

also done the following

- use both criteria classes in BasePeer, SQLBuilder, CountHelper and SummaryHelper
- make configurable which Criteria class to use in the templates. Default is the new class.
Config parameters are:
torque.om.criteriaClass = org.apache.torque.criteria.Criteria
torque.om.criterionClass = org.apache.torque.criteria.Criterion
- adjusted the test project to use the new class.
Currently, there is no easy way to run the test project against the old criteria class. will
do some copy and paste to cover basic functionality of the old criteria class.




                
> Change semantics of add() and or() methods in Criteria
> ------------------------------------------------------
>
>                 Key: TORQUE-178
>                 URL: https://issues.apache.org/jira/browse/TORQUE-178
>             Project: Torque
>          Issue Type: Improvement
>          Components: Runtime, Templates
>            Reporter: Thomas Fox
>            Assignee: Thomas Fox
>             Fix For: 4.0
>
>
> In my opinion, the Criteria.add() and Criteria.or() method 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message