You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Mike Goldner (JIRA)" <ji...@apache.org> on 2012/04/25 21:16:17 UTC

[jira] [Updated] (OPENJPA-2177) Internal field mappings reference incorrect fields when @MappedSuperclass class is not included as managed entity in persistence.xml

     [ https://issues.apache.org/jira/browse/OPENJPA-2177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Goldner updated OPENJPA-2177:
----------------------------------

    Attachment: openjpa-2177.zip

A maven/junit test case demonstrating bug.
                
> Internal field mappings reference incorrect fields when @MappedSuperclass class is not included as managed entity in persistence.xml
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2177
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2177
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: Enhance
>    Affects Versions: 2.2.0
>         Environment: Mac OS X 10.7.3, Java 1.6.0_31, OpenJPA 2.2.0, JavaDB/Derby 10.5.3.0
>            Reporter: Mike Goldner
>         Attachments: openjpa-2177.zip
>
>
> If an abstract entity class (marked as @MappedSuperclass) is extended by a concrete entity class *and* the abstract entity is *not* include in the persistence.xml as a managed class, OpenJPA incorrectly maps the entity fields.  
> Based on the SQL trace messages, it would appear that there are two different internal arrays representing the entity fields.  The StateManagerImpl._metafield contains an array of all fields on the given entity.  However, when the actual field data is fetched, a different backing array of fields is used and it does not match the _metafield array.  As a result, the wrong field is updated/fetched. 
> Attached is a simple maven/junit test case.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira