You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Matthew L. Schwickerath (JIRA)" <ji...@apache.org> on 2007/09/27 16:26:50 UTC

[jira] Created: (OPENJPA-386) org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account

org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account
-------------------------------------------------------------------------------------------------------

                 Key: OPENJPA-386
                 URL: https://issues.apache.org/jira/browse/OPENJPA-386
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.0.0, 0.9.7
         Environment: BEA WebLogic 10.0 under Windows XP SP1
            Reporter: Matthew L. Schwickerath


We have a @MappedSuperclass that is the base for all of our entity bean classes.  This class contains the @Version (and @Column for the version field) that all of our entity beans use.  But, in ClassMetaData.validateAppIdClass(), if an entity bean class has a superclass, and the entity bean has an @IdClass, it expects that superclass to have an @IdClass also.  All of our entity beans have an @IdClass (even if they only have a single part key), but our @MappedSuperclass does not have an @IdClass.  This scenario works under JBoss 4.2.0 and Sun AS 9, but produces a NullPointerException in OpenJPA at:

        if (_super != null) {
            // concrete superclass oids must match or be parent of ours
            ClassMetaData sup = getPCSuperclassMetaData();
            if (!sup.getObjectIdType().isAssignableFrom(_objectId))  // <--- NullPointerException here


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


[jira] Updated: (OPENJPA-386) org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account

Posted by "Thomas Sandor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Sandor updated OPENJPA-386:
----------------------------------

    Affects Version/s: 1.0.2

> org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-386
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-386
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.7, 1.0.0, 1.0.2
>         Environment: BEA WebLogic 10.0 under Windows XP SP1
>            Reporter: Matthew L. Schwickerath
>
> We have a @MappedSuperclass that is the base for all of our entity bean classes.  This class contains the @Version (and @Column for the version field) that all of our entity beans use.  But, in ClassMetaData.validateAppIdClass(), if an entity bean class has a superclass, and the entity bean has an @IdClass, it expects that superclass to have an @IdClass also.  All of our entity beans have an @IdClass (even if they only have a single part key), but our @MappedSuperclass does not have an @IdClass.  This scenario works under JBoss 4.2.0 and Sun AS 9, but produces a NullPointerException in OpenJPA at:
>         if (_super != null) {
>             // concrete superclass oids must match or be parent of ours
>             ClassMetaData sup = getPCSuperclassMetaData();
>             if (!sup.getObjectIdType().isAssignableFrom(_objectId))  // <--- NullPointerException here

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


[jira] Updated: (OPENJPA-386) org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account

Posted by "David Ezzio (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Ezzio updated OPENJPA-386:
--------------------------------

    Fix Version/s: 1.1.1

> org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-386
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-386
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.7, 1.0.0, 1.0.2, 1.1.0, 1.2.1
>         Environment: BEA WebLogic 10.0 under Windows XP SP1
>            Reporter: Matthew L. Schwickerath
>            Assignee: Jody Grassel
>             Fix For: 1.1.1, 1.3.0, 2.0.0-M3
>
>         Attachments: OPENJPA-386_1.0.x.patch, OPENJPA-386_1.1.x.patch, OPENJPA-386_1.2.x.patch, OPENJPA-386_1.3.x.patch, OPENJPA-386_trunk.patch
>
>
> We have a @MappedSuperclass that is the base for all of our entity bean classes.  This class contains the @Version (and @Column for the version field) that all of our entity beans use.  But, in ClassMetaData.validateAppIdClass(), if an entity bean class has a superclass, and the entity bean has an @IdClass, it expects that superclass to have an @IdClass also.  All of our entity beans have an @IdClass (even if they only have a single part key), but our @MappedSuperclass does not have an @IdClass.  This scenario works under JBoss 4.2.0 and Sun AS 9, but produces a NullPointerException in OpenJPA at:
>         if (_super != null) {
>             // concrete superclass oids must match or be parent of ours
>             ClassMetaData sup = getPCSuperclassMetaData();
>             if (!sup.getObjectIdType().isAssignableFrom(_objectId))  // <--- NullPointerException here

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


[jira] Commented: (OPENJPA-386) org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account

Posted by "Thomas Sandor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595067#action_12595067 ] 

Thomas Sandor commented on OPENJPA-386:
---------------------------------------

Matthew,
We have the same problem (and situation for storing @Version). It's great that I found this entry.

Here's a workaround that worked for me:
@MappedSuperclass
@IdClass(Object.class)

This way PCEnhancer will enhance the superclassed entities with their special @IdClass().

However, normally it should work without this extra line (Hibernate does not need that).
Please vote for this bug to be solved in the next release.

> org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-386
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-386
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.7, 1.0.0
>         Environment: BEA WebLogic 10.0 under Windows XP SP1
>            Reporter: Matthew L. Schwickerath
>
> We have a @MappedSuperclass that is the base for all of our entity bean classes.  This class contains the @Version (and @Column for the version field) that all of our entity beans use.  But, in ClassMetaData.validateAppIdClass(), if an entity bean class has a superclass, and the entity bean has an @IdClass, it expects that superclass to have an @IdClass also.  All of our entity beans have an @IdClass (even if they only have a single part key), but our @MappedSuperclass does not have an @IdClass.  This scenario works under JBoss 4.2.0 and Sun AS 9, but produces a NullPointerException in OpenJPA at:
>         if (_super != null) {
>             // concrete superclass oids must match or be parent of ours
>             ClassMetaData sup = getPCSuperclassMetaData();
>             if (!sup.getObjectIdType().isAssignableFrom(_objectId))  // <--- NullPointerException here

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


[jira] Resolved: (OPENJPA-386) org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account

Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dick resolved OPENJPA-386.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0
                   1.3.0

Thanks for the patch Jody. Patch applied to 1.3.x, and trunk. 

> org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-386
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-386
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.7, 1.0.0, 1.0.2
>         Environment: BEA WebLogic 10.0 under Windows XP SP1
>            Reporter: Matthew L. Schwickerath
>            Assignee: Jody Grassel
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-386_1.0.x.patch, OPENJPA-386_1.1.x.patch, OPENJPA-386_1.2.x.patch, OPENJPA-386_1.3.x.patch, OPENJPA-386_trunk.patch
>
>
> We have a @MappedSuperclass that is the base for all of our entity bean classes.  This class contains the @Version (and @Column for the version field) that all of our entity beans use.  But, in ClassMetaData.validateAppIdClass(), if an entity bean class has a superclass, and the entity bean has an @IdClass, it expects that superclass to have an @IdClass also.  All of our entity beans have an @IdClass (even if they only have a single part key), but our @MappedSuperclass does not have an @IdClass.  This scenario works under JBoss 4.2.0 and Sun AS 9, but produces a NullPointerException in OpenJPA at:
>         if (_super != null) {
>             // concrete superclass oids must match or be parent of ours
>             ClassMetaData sup = getPCSuperclassMetaData();
>             if (!sup.getObjectIdType().isAssignableFrom(_objectId))  // <--- NullPointerException here

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


[jira] Commented: (OPENJPA-386) org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account

Posted by "Chris Arnett (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568728#action_12568728 ] 

Chris Arnett commented on OPENJPA-386:
--------------------------------------

Any updates on this?  We're having the same problem.  These are legacy tables and we don't have the luxury of changing the schema.  We also can't use an EmbeddedId (which seems to work in this case) because one of the fields is generated while the other is not (an unsupported case for EmbeddedId).

Unless this is fixed in the Feb 15th release, we'll probably have to override WL10's JPA implementation with Hibernate (if that's even possible).

> org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-386
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-386
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.7, 1.0.0
>         Environment: BEA WebLogic 10.0 under Windows XP SP1
>            Reporter: Matthew L. Schwickerath
>
> We have a @MappedSuperclass that is the base for all of our entity bean classes.  This class contains the @Version (and @Column for the version field) that all of our entity beans use.  But, in ClassMetaData.validateAppIdClass(), if an entity bean class has a superclass, and the entity bean has an @IdClass, it expects that superclass to have an @IdClass also.  All of our entity beans have an @IdClass (even if they only have a single part key), but our @MappedSuperclass does not have an @IdClass.  This scenario works under JBoss 4.2.0 and Sun AS 9, but produces a NullPointerException in OpenJPA at:
>         if (_super != null) {
>             // concrete superclass oids must match or be parent of ours
>             ClassMetaData sup = getPCSuperclassMetaData();
>             if (!sup.getObjectIdType().isAssignableFrom(_objectId))  // <--- NullPointerException here

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


[jira] Updated: (OPENJPA-386) org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods updated OPENJPA-386:
---------------------------------

    Affects Version/s: 1.1.0
                       1.2.1
        Fix Version/s:     (was: 2.0.0)
                       2.0.0-M3

> org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-386
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-386
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.7, 1.0.0, 1.0.2, 1.1.0, 1.2.1
>         Environment: BEA WebLogic 10.0 under Windows XP SP1
>            Reporter: Matthew L. Schwickerath
>            Assignee: Jody Grassel
>             Fix For: 1.3.0, 2.0.0-M3
>
>         Attachments: OPENJPA-386_1.0.x.patch, OPENJPA-386_1.1.x.patch, OPENJPA-386_1.2.x.patch, OPENJPA-386_1.3.x.patch, OPENJPA-386_trunk.patch
>
>
> We have a @MappedSuperclass that is the base for all of our entity bean classes.  This class contains the @Version (and @Column for the version field) that all of our entity beans use.  But, in ClassMetaData.validateAppIdClass(), if an entity bean class has a superclass, and the entity bean has an @IdClass, it expects that superclass to have an @IdClass also.  All of our entity beans have an @IdClass (even if they only have a single part key), but our @MappedSuperclass does not have an @IdClass.  This scenario works under JBoss 4.2.0 and Sun AS 9, but produces a NullPointerException in OpenJPA at:
>         if (_super != null) {
>             // concrete superclass oids must match or be parent of ours
>             ClassMetaData sup = getPCSuperclassMetaData();
>             if (!sup.getObjectIdType().isAssignableFrom(_objectId))  // <--- NullPointerException here

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


[jira] Updated: (OPENJPA-386) org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account

Posted by "Milosz Tylenda (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Milosz Tylenda updated OPENJPA-386:
-----------------------------------

    Patch Info: [Patch Available]

> org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-386
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-386
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.7, 1.0.0, 1.0.2
>         Environment: BEA WebLogic 10.0 under Windows XP SP1
>            Reporter: Matthew L. Schwickerath
>            Assignee: Jody Grassel
>         Attachments: OPENJPA-386_1.0.x.patch, OPENJPA-386_1.1.x.patch, OPENJPA-386_1.2.x.patch, OPENJPA-386_1.3.x.patch, OPENJPA-386_trunk.patch
>
>
> We have a @MappedSuperclass that is the base for all of our entity bean classes.  This class contains the @Version (and @Column for the version field) that all of our entity beans use.  But, in ClassMetaData.validateAppIdClass(), if an entity bean class has a superclass, and the entity bean has an @IdClass, it expects that superclass to have an @IdClass also.  All of our entity beans have an @IdClass (even if they only have a single part key), but our @MappedSuperclass does not have an @IdClass.  This scenario works under JBoss 4.2.0 and Sun AS 9, but produces a NullPointerException in OpenJPA at:
>         if (_super != null) {
>             // concrete superclass oids must match or be parent of ours
>             ClassMetaData sup = getPCSuperclassMetaData();
>             if (!sup.getObjectIdType().isAssignableFrom(_objectId))  // <--- NullPointerException here

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


[jira] Commented: (OPENJPA-386) org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account

Posted by "David Ezzio (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789047#action_12789047 ] 

David Ezzio commented on OPENJPA-386:
-------------------------------------

Applied Jody's patch to 1.1.x branch at rev 889476.  

> org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-386
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-386
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 0.9.7, 1.0.0, 1.0.2, 1.1.0, 1.2.1
>         Environment: BEA WebLogic 10.0 under Windows XP SP1
>            Reporter: Matthew L. Schwickerath
>            Assignee: Jody Grassel
>             Fix For: 1.1.1, 1.3.0, 2.0.0-M3
>
>         Attachments: OPENJPA-386_1.0.x.patch, OPENJPA-386_1.1.x.patch, OPENJPA-386_1.2.x.patch, OPENJPA-386_1.3.x.patch, OPENJPA-386_trunk.patch
>
>
> We have a @MappedSuperclass that is the base for all of our entity bean classes.  This class contains the @Version (and @Column for the version field) that all of our entity beans use.  But, in ClassMetaData.validateAppIdClass(), if an entity bean class has a superclass, and the entity bean has an @IdClass, it expects that superclass to have an @IdClass also.  All of our entity beans have an @IdClass (even if they only have a single part key), but our @MappedSuperclass does not have an @IdClass.  This scenario works under JBoss 4.2.0 and Sun AS 9, but produces a NullPointerException in OpenJPA at:
>         if (_super != null) {
>             // concrete superclass oids must match or be parent of ours
>             ClassMetaData sup = getPCSuperclassMetaData();
>             if (!sup.getObjectIdType().isAssignableFrom(_objectId))  // <--- NullPointerException here

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