OpenJPA
  1. OpenJPA
  2. OPENJPA-1613

Exception thrown when enhancing a (property access) class that has an abstract @MappedSuperclass with no annotated properties

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-beta2, 2.0.0-beta3
    • Fix Version/s: 2.1.0
    • Component/s: kernel
    • Labels:
      None

      Description

      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

      1. abstract-subclass.patch
        6 kB
        Simon Droscher
      2. OPENJPA-1613-tests.diff
        9 kB
        Donald Woods
      3. OPENJPA-1613-failing-code-changes.diff
        6 kB
        Donald Woods

        Activity

        Simon Droscher created issue -
        Simon Droscher made changes -
        Field Original Value New Value
        Attachment abstract-subclass.patch [ 12440971 ]
        Donald Woods made changes -
        Fix Version/s 2.0.1 [ 12314532 ]
        Donald Woods made changes -
        Attachment OPENJPA-1613-tests.diff [ 12442196 ]
        Donald Woods made changes -
        Attachment OPENJPA-1613-failing-code-changes.diff [ 12442197 ]
        Jeremy Bauer made changes -
        Assignee Jeremy Bauer [ techhusky ]
        Donald Woods made changes -
        Fix Version/s 2.0.2 [ 12315257 ]
        Fix Version/s 2.1.0 [ 12314542 ]
        Fix Version/s 2.0.1 [ 12314532 ]
        Michael Dick made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.2 [ 12315257 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Jeremy Bauer
            Reporter:
            Simon Droscher
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development