X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Fpolicy%2Foperational%2FOperationalPolicy.java;h=d9e8a57d6eb5a6b6d752233038a25d63618384f9;hb=5dfa4b58906921dea2aab38d20d761f460f49964;hp=df7e27bf3978243307cfa392454adf178915ea4e;hpb=8c2ce6065ddd8405ef3faa99969453e080b63f55;p=clamp.git diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java index df7e27bf..d9e8a57d 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java +++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java @@ -46,6 +46,7 @@ import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.JoinColumn; +import javax.persistence.JoinColumns; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Transient; @@ -55,6 +56,7 @@ import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; import org.onap.clamp.dao.model.jsontype.StringJsonUserType; import org.onap.clamp.loop.Loop; +import org.onap.clamp.loop.template.PolicyModel; import org.onap.clamp.policy.Policy; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; @@ -90,6 +92,12 @@ public class OperationalPolicy implements Serializable, Policy { @JoinColumn(name = "loop_id", nullable = false) private Loop loop; + @Expose + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumns({ @JoinColumn(name = "policy_model_type", referencedColumnName = "policy_model_type"), + @JoinColumn(name = "policy_model_version", referencedColumnName = "version") }) + private PolicyModel policyModel; + public OperationalPolicy() { // Serialization } @@ -137,6 +145,33 @@ public class OperationalPolicy implements Serializable, Policy { this.configurationsJson = configurationsJson; } + /** + * policyModel getter. + * + * @return the policyModel + */ + public PolicyModel getPolicyModel() { + return policyModel; + } + + /** + * policyModel setter. + * + * @param policyModel the policyModel to set + */ + public void setPolicyModel(PolicyModel policyModel) { + this.policyModel = policyModel; + } + + /** + * name setter. + * + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + @Override public JsonObject getJsonRepresentation() { return jsonRepresentation;