openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Donald Woods (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1613) Exception thrown when enhancing a (property access) class that has an abstract @MappedSuperclass with no annotated properties
Date Mon, 12 Apr 2010 20:37:48 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856155#action_12856155
] 

Donald Woods commented on OPENJPA-1613:
---------------------------------------

Well, since you marked the methods with @Transient, the PersistenceMetaDataDeafults.determineImplicitAccessType()
will return ACCESS_UNKNOWN, as those methods are removed from consideration, which causes
PersistenceMetaDataDeafults.determineAccessType() to call getDeafultAccessType() which returns
the default of ACCESS_FIELD.


> Exception thrown when enhancing a (property access) class that has an abstract @MappedSuperclass
with no annotated properties
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1613
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1613
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 2.0.0-beta2, 2.0.0-beta3
>            Reporter: Simon Droscher
>             Fix For: 2.0.1
>
>         Attachments: abstract-subclass.patch
>
>
> If you have a class (using property access) that has an abstract @MappedSuperclass that
happens to have no annotated methods, you get the following exception when enhancing:
> org.apache.openjpa.util.MetaDataException: "implicit property access" for class "org.apache.openjpa.persistence.simple.SubclassPerson"
is not consistent with "implicit field access" used by its persistent superclass "org.apache.openjpa.persistence.simple.AbstractSuperclass".
 All persistent classes in an inheritance hierarchy must use a single implicit field or property
based access style or explicitly declare an access style.
> Presumably the enhancer is deciding incorrectly that the superclass is using field access.
A workaround is to annotate the superclass with @Access(AccessType.PROPERTY)  so the enhancer
doesn't make this assumption, but that is not JPA 1.0 backwards compatible.
> This did not occur in any of the OpenJPA 1.* versions

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

        

Mime
View raw message