openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fay Wang (JIRA)" <>
Subject [jira] Commented: (OPENJPA-953) ArrayIndexOutOfBoundsException in org.apache.openjpa.util.ApplicationIds$PrimaryKeyFieldManager.retrieve
Date Wed, 04 Mar 2009 18:35:56 GMT


Fay Wang commented on OPENJPA-953:

This problem is about the inheritance of entities and their respective IdClass. 
The following scenarios are attempted to narrow down the problem:

(1) abstract parent P (Entity) <-- child C
    parentId PId <-- childId CId
==> Exception: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 2
	at org.apache.openjpa.util.ApplicationIds$PrimaryKeyFieldManager.retrieve

(2) abstract parent P (MappedSuperClass) <-- child C
      parentId PId <-- childId CId
==> works fine

(3) concrete parent P (Entity) <-- child C
      parentId PId <-- childId CId
==> org.apache.openjpa.util.MetaDataException: Primary key fields can only be declared
in base persistent classes that also declare their identity-type to be "application".
	at org.apache.openjpa.meta.ClassMetaData.validateNoPKFields

Case (1) is reported by Mike in this JIRA.  It appears that openjpa does not properly handle
the IdClass inheritance when parent class is an abstract class, but annotated as Entity. The
proposed solutions could be: 
(a) throw an exception as in case (3)
(b) make it work as in case (2)

Any suggestion?

> ArrayIndexOutOfBoundsException in org.apache.openjpa.util.ApplicationIds$PrimaryKeyFieldManager.retrieve
> --------------------------------------------------------------------------------------------------------
>                 Key: OPENJPA-953
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>            Reporter: Michael Vorburger
>         Attachments:
> As per the email thread "ArrayIndexOutOfBoundsException in org.apache.openjpa.util.ApplicationIds$PrimaryKeyFieldManager.retrieve"
on yesterday (see,
there is a confirmed (Fay Wang) openjpa bug when using  application ID Identity Hierarchies
as per,
may be because I was trying to use them together with Entities as Identity Fields as per

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

View raw message