Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 18372 invoked from network); 15 Mar 2010 10:12:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Mar 2010 10:12:35 -0000 Received: (qmail 67771 invoked by uid 500); 15 Mar 2010 10:11:49 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 67601 invoked by uid 500); 15 Mar 2010 10:11:48 -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 67586 invoked by uid 99); 15 Mar 2010 10:11:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Mar 2010 10:11:48 +0000 X-ASF-Spam-Status: No, hits=-1011.3 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Mar 2010 10:11:47 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 286EC234C1F0 for ; Mon, 15 Mar 2010 10:11:27 +0000 (UTC) Message-ID: <553342108.263291268647887164.JavaMail.jira@brutus.apache.org> Date: Mon, 15 Mar 2010 10:11:27 +0000 (UTC) From: "Krzysztof (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-1572) ApplicationIdTool generated ID classes do not cater for embedded composite IDs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 ApplicationIdTool generated ID classes do not cater for embedded composite IDs ------------------------------------------------------------------------------ Key: OPENJPA-1572 URL: https://issues.apache.org/jira/browse/OPENJPA-1572 Project: OpenJPA Issue Type: Bug Components: tooling Affects Versions: 2.0.0-beta2 Reporter: Krzysztof Having ClassB identified by the composite identity of the classA which has a 'simple types' composite identity, i.e.: class ClassA { @Id int x; @Id int y; } class ClassB { @Id ClassA cA; @Id int b; } Generated ClassBId.fromstring passes only part of the string representation of ClassA id to classA string constructor as nexttoken is not aware of the composition of the ID and always extracts a single token which will result in the null exception. CLassBId { ... private void fromString(String str) { Tokenizer toke = new Tokenizer(str); str = toke.nextToken(); if ("null".equals(str)) b = null; else b = str; str = toke.nextToken(); if ("null".equals(str)) cA = null; else cA = new classA.classAId(str); } so, obviously for classB with a string representation like 0::1::2 only "1" is passed to the constructor using ClassA.toString which results in wrong initialization. I have not been using detachement/attachment and have been wondering if this inconsistency may have other impact during an object lifecycle. The solution would be to pass full remaining part of the string and return the last position for subsequent tokens extraction somehow. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.