Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 73158 invoked from network); 7 Dec 2007 12:11:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2007 12:11:38 -0000 Received: (qmail 60362 invoked by uid 500); 7 Dec 2007 12:11:27 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 60126 invoked by uid 500); 7 Dec 2007 12:11:26 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 60117 invoked by uid 99); 7 Dec 2007 12:11:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Dec 2007 04:11:26 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.78.103.231] (HELO vorsha.objectstyle.org) (208.78.103.231) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 07 Dec 2007 12:11:06 +0000 Received: (qmail 19154 invoked from network); 7 Dec 2007 12:11:08 -0000 Received: from unknown (HELO localhost) (127.0.0.1) by localhost with SMTP; 7 Dec 2007 12:11:08 -0000 Message-Id: <1F4FC486-B8AA-4196-B4D5-B2F1A4129CAD@objectstyle.org> From: Andrus Adamchik To: user@cayenne.apache.org In-Reply-To: <9cc55f600711271356x4181f0b0x3796d24cf4445a3e@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Subject: Re: ExtendedType and IN operator Date: Fri, 7 Dec 2007 14:11:07 +0200 References: <9cc55f600711221739y75045647p37205f0f131621f1@mail.gmail.com> <9cc55f600711271356x4181f0b0x3796d24cf4445a3e@mail.gmail.com> X-Mailer: Apple Mail (2.915) X-Virus-Checked: Checked by ClamAV on apache.org Chris, I just added a few similar unit tests to 3.0 and they seem to work just fine, matching on custom types in the IN list. Could you possibly try to upgrade to 3.0M2 and see if the problem is still there? Thanks Andrus On Nov 27, 2007, at 11:56 PM, Chris Gamache wrote: > Exact Cayenne Version is 2.0.3 > > Here's the query builder... > > public static List selectMulti(final DataContext context,final > ArrayList userUuids, final Date fromDate, final Date toDate, > final int status) { > > ArrayList expList = new ArrayList(); > > //this is where the trouble is... > if (userUuids != null && userUuids.size() > 0) > expList.add(ExpressionFactory.inExp(TodOrders.USER_UUID_PROPERTY, > userUuids)); > > > if (fromDate != null && toDate != null) { > > expList > .add(ExpressionFactory.betweenExp(TodOrders.TRANS_DATE_PROPERTY, > fromDate, toDate)); > } else if (fromDate != null && toDate == null) { > > expList > .add > (ExpressionFactory.greaterOrEqualExp(TodOrders.TRANS_DATE_PROPERTY, > fromDate)); > } else if (fromDate == null && toDate != null) { > > expList > .add(ExpressionFactory.lessOrEqualExp(TodOrders.TRANS_DATE_PROPERTY, > toDate)); > } > > if (status == 1) { > > expList.add(ExpressionFactory.matchExp(TodOrders.FULFILLED_PROPERTY, > null)); > } else if (status == 2) { > > expList.add(ExpressionFactory.noMatchExp(TodOrders.FULFILLED_PROPERTY, > null)); > } > SelectQuery orderQuery = new > SelectQuery(TodOrders.class,ExpressionFactory.joinExp(Expression.AND, > expList)); > orderQuery.addOrdering(new Ordering(TodOrders.TRANS_DATE_PROPERTY, > true)); > > return context.performQuery(orderQuery); > > } > > > On Nov 26, 2007 7:42 AM, Andrus Adamchik > wrote: >> Chris, >> >> I vaguely remember this being a problem in the past and us fixing >> it... I couldn't find any references via Google (having "IN" as a >> keyword doesn't help). So could you post the code that builds the >> query and the exact Cayenne version. >> >> Thanks >> Andrus >> >> >> >> On Nov 23, 2007, at 3:39 AM, Chris Gamache wrote: >> >>> I'm using Cayenne2 and PostgreSQL. >>> >>> For any single R-value in a where clause, my ExtendedType is working >>> wonderfully. But! If I create an expression which uses the operator >>> IN, my ExtendedType doesn't seem to get called. In the query logger >>> everything looks okay, but pgjdbc complains in the same way that it >>> would if there were no exended type. That leads me to believe either >>> that Cayenne is ignoring ExtendedTypes when it does the JDBC binding >>> for the R-value list, or that I've left out a detail in my >>> ExtendedType class which is the culprit. I can post my ExtendedType >>> code and some code that misbehaves. Will that suffice, or would you >>> need more? >>> >>> CG >>> >> >> >