Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 41471 invoked from network); 2 Feb 2007 23:23:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Feb 2007 23:23:29 -0000 Received: (qmail 56468 invoked by uid 500); 2 Feb 2007 23:23:33 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 56417 invoked by uid 99); 2 Feb 2007 23:23:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Feb 2007 15:23:33 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Feb 2007 15:23:26 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DA8117142D4 for ; Fri, 2 Feb 2007 15:23:05 -0800 (PST) Message-ID: <7163517.1170458585892.JavaMail.jira@brutus> Date: Fri, 2 Feb 2007 15:23:05 -0800 (PST) From: "Craig Russell (JIRA)" To: jdo-dev@db.apache.org Subject: [jira] Commented: (JDO-378) SQL query : executeWithMap test In-Reply-To: <17009659.1146553426413.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JDO-378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469906 ] Craig Russell commented on JDO-378: ----------------------------------- Looks very good. Just one nit to pick. I think that using a variable for the value of the "positive" and "unique" parameters hurts readability, because you have to go from the method up to where the values of unique and positive are defined. I'd rather see inline what these parameter values are. Instead of: + boolean unique = false; + boolean positive = true; ... + executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], + PrimitiveTypes.class, null, positive, + parameterMap[index], expectedResult[index], unique); it would be more obvious as: ... + executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], + PrimitiveTypes.class, null, true, + parameterMap[index], expectedResult[index], false); But if you want to combine both the "self-describing parameter" and the "self-describing value" concepts you could do this: + boolean uniqueFalse = false; + boolean positiveTrue = true; ... + executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], + PrimitiveTypes.class, null, positiveTrue, + parameterMap[index], expectedResult[index], uniqueFalse); Just an idea. > SQL query : executeWithMap test > ------------------------------- > > Key: JDO-378 > URL: https://issues.apache.org/jira/browse/JDO-378 > Project: JDO > Issue Type: Test > Components: tck2 > Affects Versions: JDO 2 final > Reporter: Andy Jefferson > Assigned To: Michelle Caisse > Priority: Minor > Fix For: JDO 2 maintenance release 1 > > Attachments: jdo-378-2.patch, jdo-378.patch > > > SQL queries when executed using executeWithMap() should check that the Map contains keys of type Integer and with values starting at 1. There don't seem to be any tests for SQL Query.executeWithMap in the TCK (as I just found out performing such a query with JPOX and getting an incorrect result) and so would be a good addition for any maintenance release. JPOX CVS now supports this behaviour btw. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.