Uploaded image for project: 'Policy Framework'
  1. Policy Framework
  2. POLICY-3897

Fix issue with usage of GeneratedValue in PfGeneratedIdKey

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • Jakarta Release
    • Istanbul Release
    • models, pap
    • None

      The documentation states, The GeneratedValue  annotation may be applied to a primary key property or field of an entity or mapped superclass in conjunction with the Id annotation. The use of the GeneratedValue annotation is only required to be supported for simple primary keys. https://docs.oracle.com/javaee/7/api/javax/persistence/GeneratedValue.html

      But, PfGeneratedIdKey class which is used as a composite key by JpaPolicyAudit and JpaPdpStatistics uses GeneratedValue in the wrong way  https://github.com/onap/policy-models/blob/master/models-base/src/main/java/org/onap/policy/models/base/PfGeneratedIdKey.java#L60

      This bug is trying to fix the above problem.

      Note: Even though the current code base is not following the specification, Eclipselink today is not complaining about it. Any change to fix this issue should only affect JpaPolicyAudit and JpaPdpStatistics classes, and not on functionality .

       

            a.sreekumar a.sreekumar
            a.sreekumar a.sreekumar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: