OpenJPA
  1. OpenJPA
  2. OPENJPA-2325

MappedSuperClass without an @Id causes wrong identity type for the inherited types

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.3.0
    • Component/s: kernel
    • Labels:
      None

      Description

      A MappedSuperClass without a declared identity field can cause the derived classes that have decalred an @Id field to be wrongly using DATASTORE identity type because the identity type of its superclass being UNKNOWN leads the derived type to use the default identity type, which for JPA faced is set to DATASTORE.
      The suggested change modifies the logic of ClassMetaData while detecting the identity type whether it is an abstract (i.e. MappedSuperClass). Also introduced a change that distinguishes whether the identity type was ever evaluated versus whether identity type is indeterminable (i.e. UNKNOWN) which will will save few cycles for this commonly invoked operation. Previously for UNKNOWN type was indistinguishable from the case where identity type was never evaluated.

        Activity

        Hide
        ASF subversion and git services added a comment -

        Commit 1471807 from hthomann
        [ https://svn.apache.org/r1471807 ]

        OPENJPA-2325: MappedSuperClass without an @Id causes wrong identity type for the inherited types - back-ported to 2.2.x Pinaki Poddar's commit to trunk.

        Show
        ASF subversion and git services added a comment - Commit 1471807 from hthomann [ https://svn.apache.org/r1471807 ] OPENJPA-2325 : MappedSuperClass without an @Id causes wrong identity type for the inherited types - back-ported to 2.2.x Pinaki Poddar's commit to trunk.
        Hide
        ASF subversion and git services added a comment -

        Commit 1470097 from hthomann
        [ https://svn.apache.org/r1470097 ]

        OPENJPA-2325: MappedSuperClass without an @Id causes wrong identity type for the inherited types - back-ported to 2.2.1.x Pinaki Poddar's commit to trunk.

        Show
        ASF subversion and git services added a comment - Commit 1470097 from hthomann [ https://svn.apache.org/r1470097 ] OPENJPA-2325 : MappedSuperClass without an @Id causes wrong identity type for the inherited types - back-ported to 2.2.1.x Pinaki Poddar's commit to trunk.
        Hide
        ASF subversion and git services added a comment -

        Commit 1469949 from hthomann
        [ https://svn.apache.org/r1469949 ]

        OPENJPA-2325: MappedSuperClass without an @Id causes wrong identity type for the inherited types - back-ported to 2.1.x Pinaki Poddar's commit to trunk.

        Show
        ASF subversion and git services added a comment - Commit 1469949 from hthomann [ https://svn.apache.org/r1469949 ] OPENJPA-2325 : MappedSuperClass without an @Id causes wrong identity type for the inherited types - back-ported to 2.1.x Pinaki Poddar's commit to trunk.
        Hide
        ASF subversion and git services added a comment -

        Commit 1469582 from hthomann
        [ https://svn.apache.org/r1469582 ]

        OPENJPA-2325: MappedSuperClass without an @Id causes wrong identity type for the inherited types - back-ported to 2.0.x Pinaki Poddar's commit to trunk, as well as an additional change he made specific to 2.0.x.

        Show
        ASF subversion and git services added a comment - Commit 1469582 from hthomann [ https://svn.apache.org/r1469582 ] OPENJPA-2325 : MappedSuperClass without an @Id causes wrong identity type for the inherited types - back-ported to 2.0.x Pinaki Poddar's commit to trunk, as well as an additional change he made specific to 2.0.x.
        Hide
        Pinaki Poddar added a comment -

        The problem surfaces when an instance of the derived class (using application identity) created via new operator is merged while an instance with the same identity value exists.

        Show
        Pinaki Poddar added a comment - The problem surfaces when an instance of the derived class (using application identity) created via new operator is merged while an instance with the same identity value exists.

          People

          • Assignee:
            Pinaki Poddar
            Reporter:
            Pinaki Poddar
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development