Fix Reference Key columns persistence issue in db 20/118720/5
authorrameshiyer27 <ramesh.murugan.iyer@est.tech>
Mon, 1 Mar 2021 18:46:33 +0000 (18:46 +0000)
committerrameshiyer27 <ramesh.murugan.iyer@est.tech>
Wed, 3 Mar 2021 12:50:47 +0000 (12:50 +0000)
commitfcbf3698fa3e3fbc6ea3364d80d4a3f3a8d37650
tree20db6b9b856b0a3c6020b2986967c5df0c594401
parent726bec7cd5e1b0f5c45b3ec58bc64e344240e8c9
Fix Reference Key columns persistence issue in db

Problem: When PfReferenceTimestamp Key is persisted in db, the parent
class fields are ignored which causes inconsistent data while saving and
fetching in db.

Fix: JPA is not supporting inheritance in @Embeddable classes. Hence
included the super class as @Embedded property in PfReferenceTimestamp
key. @Embedded properties are unable to be queried directly. Slightly
modified Dao methods to support querying @embedded fields.

Issue-ID: POLICY-3049
Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech>
Change-Id: I5c2e03a5ae98525764a64dd6cce1a1298c5f9816
models-base/src/main/java/org/onap/policy/models/base/PfReferenceTimestampKey.java
models-base/src/test/java/org/onap/policy/models/base/PfReferenceTimestampKeyTest.java
models-dao/src/main/java/org/onap/policy/models/dao/PfDao.java
models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java