Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-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 CBAF79EBE for ; Thu, 22 Mar 2012 18:20:45 +0000 (UTC) Received: (qmail 61738 invoked by uid 500); 22 Mar 2012 18:20:45 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 61707 invoked by uid 500); 22 Mar 2012 18:20:45 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 61698 invoked by uid 99); 22 Mar 2012 18:20:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2012 18:20:45 +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; Thu, 22 Mar 2012 18:20:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 0FB4634030B for ; Thu, 22 Mar 2012 18:20:22 +0000 (UTC) Date: Thu, 22 Mar 2012 18:20:22 +0000 (UTC) From: "Herman Vierendeels (Created) (JIRA)" To: dev@openjpa.apache.org Message-ID: <2019196931.3558.1332440422100.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (OPENJPA-2160) jest findcommand compound/composite primary keys 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 jest findcommand compound/composite primary keys ------------------------------------------------ Key: OPENJPA-2160 URL: https://issues.apache.org/jira/browse/OPENJPA-2160 Project: OpenJPA Issue Type: Bug Components: jpa Affects Versions: 2.2.0 Reporter: Herman Vierendeels Priority: Minor Fix For: 2.2.0 Attachments: findcommand.diff jest find command with compound/composite primary key http://localhost:8080/openjpa_jest/jest/find/format=json?type=FAKTUREN&FBJ=2012&FNR=4 diff 23d22 < import java.lang.reflect.Modifier; 31d29 < import java.util.Set; 33d30 < import org.apache.openjpa.enhance.PCRegistry; 36d32 < import org.apache.openjpa.meta.FieldMetaData; 39,40d34 < import org.apache.openjpa.util.ObjectId; < import org.apache.openjpa.lib.log.Log; 78,82c72,74 < Object[] keys_obj=parameters.keySet().toArray(); < FieldMetaData[] fmds=meta.getPrimaryKeyFields(); < if(fmds.length!=parameters.size()) < { < throw new ProcessingException(ctx,new Exception("number of primaryKeys "+fmds.length+" differs from number of arguments "+parameters.size())); --- > Iterator> params = parameters.entrySet().iterator(); > for (int i = 0; i < parameters.size(); i++) { > pks[i] = params.next().getKey(); 84,104d75 < for(int i=0;i0) < { < throw new ProcessingException(ctx,new Exception("if more than 1 primaryKey parm value,primaryKey parm value should be coded as primaryKeyField=primaryKeyValue because arguments are collected into map which does not respect sequence")); < } < } < } 106,109d76 < if(oid instanceof ObjectId) < { < oid=((ObjectId)oid).getIdObject(); < } -- 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