Return-Path: X-Original-To: apmail-db-torque-dev-archive@www.apache.org Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 63D229623 for ; Sun, 15 Jan 2012 14:01:03 +0000 (UTC) Received: (qmail 70529 invoked by uid 500); 15 Jan 2012 14:01:03 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 70501 invoked by uid 500); 15 Jan 2012 14:01:03 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 70488 invoked by uid 99); 15 Jan 2012 14:01:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Jan 2012 14:01:03 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Jan 2012 14:01:00 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D46D514E79F for ; Sun, 15 Jan 2012 14:00:39 +0000 (UTC) Date: Sun, 15 Jan 2012 14:00:39 +0000 (UTC) From: "Thomas Fox (Commented) (JIRA)" To: torque-dev@db.apache.org Message-ID: <1909615101.42670.1326636039871.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1423893363.45754.1324946550885.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (TORQUE-178) Change semantics of add() and or() methods in Criteria MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ 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