openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pinaki Poddar (JIRA)" <>
Subject [jira] Commented: (OPENJPA-207) failure when composite ID has another composite ID as a field
Date Mon, 21 Jul 2008 18:03:33 GMT


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:
>             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:
> 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
>  at org.apache.openjpa.util.ApplicationIds.create(
>  at org.apache.openjpa.kernel.BrokerImpl.persist( 
> 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

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message