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

Getter/Setter type inconsistency in Entity IdClass

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 1.0.0
    • jpa
    • None

    Description

      In this excerpt from ClassMetaData, we are seeking getter and setter in an identity class. We should be seeking getter and setter with type of Entity class's key, not type of Entity class per se. The getter code refers to "c", which was earlier set to the correct object id field type. But the setter-seeking code refers incorrectly to "fmds[i].getDeclaredType()". This is a show-stopper, as it makes OpenJPA manual section 3.2 un-implementable.

      if (m == null || !m.getReturnType().isAssignableFrom(c))
      throw new MetaDataException(_loc.get("invalid-id",
      _type, fmds[i].getName()));
      m = Reflection.findSetter(oid, fmds[i].getName(),
      fmds[i].getDeclaredType(), false);
      if (m == null || m.getReturnType() != void.class)
      throw new MetaDataException(_loc.get("invalid-id",
      _type, fmds[i].getName()));

      Attachments

        1. jira257.patch
          0.8 kB
          Pinaki Poddar

        Activity

          People

            Unassigned Unassigned
            jdf@us.ibm.com Jonathan Feinberg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: