Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 43304 invoked from network); 24 Sep 2004 14:32:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 24 Sep 2004 14:32:42 -0000 Received: (qmail 38509 invoked by uid 500); 24 Sep 2004 14:34:40 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 38482 invoked by uid 500); 24 Sep 2004 14:34:38 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 38463 invoked by uid 99); 24 Sep 2004 14:34:38 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [64.62.231.94] (HELO linode1.vawter.com) (64.62.231.94) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 24 Sep 2004 07:34:36 -0700 Received: from [192.168.0.16] (c-24-8-10-18.client.comcast.net [24.8.10.18]) by linode1.vawter.com (Postfix) with ESMTP id 87E6B12C78 for ; Fri, 24 Sep 2004 08:34:35 -0600 (MDT) Message-ID: <41542FF0.7020704@vawter.com> Date: Fri, 24 Sep 2004 08:32:16 -0600 From: Don Vawter User-Agent: Mozilla Thunderbird 0.8 (X11/20040918) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Apache Torque Users List Subject: doDelete and Criteria failing (2nd request) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I have been having trouble with mail filters. If I missed a response I apologize. I am attempting to delete records with the constraint DAILYDATE >= start and DAILYDATE <= stop I I have the following code Criteria crit = new Criteria(); Criterion a1 = crit.getNewCriterion(TblDailydataPeer.DAILYDATE,start.getTime(),Criteria.GREATER_EQUAL); Criterion a2= crit.getNewCriterion(TblDailydataPeer.DAILYDATE,stop.getTime(),Criteria.LESS_EQUAL); crit.add(a1.and(a2)); logger.debug("Criteria is "+crit); TblDailydataPeer.doDelete(crit); /* ArrayList aList= (ArrayList) TblDailydataPeer.doSelect(crit); Iterator it = aList.iterator(); while(it.hasNext()){ TblDailydata td = (TblDailydata) it.next(); TblDailydataPeer.doDelete(td); } */ The doDelete picks up the first date but not the second (see the log) a doSelect picks up both (see the log) LOG DEBUG,2004-09-21 12:04:23,com.vawter.omreporting.utility.DatabaseUpdate,Criteria is Criteria:: tbl_DailyData.DAILYDATE<=>(tbl_DailyData.DAILYDATE>='20040112000000' AND tbl_DailyData.DAILYDATE<='20050101000000'): Current Query SQL (may not be complete or applicable): SELECT FROM tbl_DailyData WHERE (tbl_DailyData.DAILYDATE>='20040112000000' AND tbl_DailyData.DAILYDATE<='20050101000000') DEBUG,2004-09-21 12:04:23,org.apache.torque.util.BasePeer,BasePeer.doDelete: whereClause=DAILYDATE>='20040112000000' I can work around this by commenting out the doDelete and substituring the commented out code above which does the select and then deletes the row but I wouldn't think this should be necessary. Any clue as to why the entire criteria is not used and/or how to construct a criteria which will work? --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org