From dev-return-8695-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Mon Jul 21 18:04:04 2008 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 92628 invoked from network); 21 Jul 2008 18:04:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jul 2008 18:04:04 -0000 Received: (qmail 18072 invoked by uid 500); 21 Jul 2008 18:03:56 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 18053 invoked by uid 500); 21 Jul 2008 18:03:56 -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 17997 invoked by uid 99); 21 Jul 2008 18:03:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2008 11:03:55 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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, 21 Jul 2008 18:03:08 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7B0B0234C16A for ; Mon, 21 Jul 2008 11:03:33 -0700 (PDT) Message-ID: <748532477.1216663413499.JavaMail.jira@brutus> Date: Mon, 21 Jul 2008 11:03:33 -0700 (PDT) From: "Pinaki Poddar (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-207) failure when composite ID has another composite ID as a field 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/OPENJPA-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615338#action_12615338 ] Pinaki Poddar commented on OPENJPA-207: --------------------------------------- The change incorporated includes a change in enhancer. The multiple-level of derived identity is handled in enhancer by proper casts. Runtime is modified to accommodate a user-defined identity class by wrapping it in OpenJPA wrapper identity type i.e. org.apache.openjpa.util.ObjectId. The attached test by the issue reporter is cannibalized (with due references) in OpenJPA test suite. > failure when composite ID has another composite ID as a field > -------------------------------------------------------------- > > Key: OPENJPA-207 > URL: https://issues.apache.org/jira/browse/OPENJPA-207 > Project: OpenJPA > Issue Type: Bug > Affects Versions: 0.9.6 > Environment: derby > jdk 1.5.0_07 > Reporter: Jeffrey Blattman > Assignee: Pinaki Poddar > Priority: Minor > Attachments: book.zip > > > see attached test case: entities Library, Book, and Page. there is a one-many bidirectional relationship between Library and Book, and Book and Page. a Library's ID is simply it's name. a Book's ID is it's name, plus it's owning library's ID. A Page's ID is it's number, plus it's owning Book's ID. > this arrangement results in composite IDs for Book and Page. and moreover, Page's composite ID, PageId, contains a page number field plus a BookId. however, this arrangement results in an exception at runtime w/ the included test case ... > ... > Caused by: java.lang.ClassCastException: org.apache.openjpa.util.ObjectId > at com.mycompany.book.Page.pcCopyKeyFieldsToObjectId(Page.java) > at org.apache.openjpa.util.ApplicationIds.create(ApplicationIds.java:383) > at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2349) > note that if i remove the bookId field from PageId, the test case succeeds. > also note that this problem is also observed against a trunk field from march 3 (0.9.7 snapshot). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.