Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2325

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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.

        Attachments

          Activity

            People

            • Assignee:
              ppoddar@apache.org Pinaki Poddar
              Reporter:
              ppoddar@apache.org Pinaki Poddar
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: