Mike Goldner created OPENJPA-2177:
-------------------------------------
Summary: 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