X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Frest%2Fjpa%2FObadviceExpression.java;h=9d82b7325bf3c8f1e25f983ba1668a16a1de0286;hb=023280727ac52e777b4128d726e212c9e8abd435;hp=8d5be97426e7c53c18faee35e13afa47b85c2d74;hpb=073cc188efe9abb4c010cf674e34e2cf46ef1c52;p=policy%2Fengine.git diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ObadviceExpression.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ObadviceExpression.java index 8d5be9742..9d82b7325 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ObadviceExpression.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ObadviceExpression.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-REST * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,82 +42,77 @@ import javax.persistence.Table; @Table(name="ObadviceExpressions") @NamedQuery(name="ObadviceExpression.findAll", query="SELECT o FROM ObadviceExpression o") public class ObadviceExpression implements Serializable { - private static final long serialVersionUID = 1L; - - public static final String EXPRESSION_APPLY = "Apply"; - public static final String EXPRESSION_SELECTOR = "Attribute Selector"; - public static final String EXPRESSION_VALUE = "Attribute Value"; - public static final String EXPRESSION_FUNCTION = "Function"; - public static final String EXPRESSION_REFERENCE = "Varable Reference"; - public static final String EXPRESSION_DESIGNATOR = "Attribute Designator"; - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") - private int id; - - //unidirectional one-to-one association to Attribute - @OneToOne - @JoinColumn(name="attribute_id") - private Attribute attribute; - - @Column(name="type", nullable=false) - private String type; - - /* - @Lob - @Column(name="expression", nullable=false) - private byte[] expression; - */ - - //bi-directional many-to-one association to Obadvice - @ManyToOne - @JoinColumn(name="obadvice_id") - private Obadvice obadvice; - - public ObadviceExpression() { - type = EXPRESSION_VALUE; - } - - public int getId() { - return this.id; - } - - public void setId(int id) { - this.id = id; - } - - public Attribute getAttribute() { - return this.attribute; - } - - public void setAttribute(Attribute attribute) { - this.attribute = attribute; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public Obadvice getObadvice() { - return this.obadvice; - } - - public void setObadvice(Obadvice obadvice) { - this.obadvice = obadvice; - } - - public ObadviceExpression clone() { - ObadviceExpression expression = new ObadviceExpression(); - - expression.attribute = this.attribute; - expression.type = this.type; - expression.obadvice = this.obadvice; - - return expression; - } + private static final long serialVersionUID = 1L; + + public static final String EXPRESSION_APPLY = "Apply"; + public static final String EXPRESSION_SELECTOR = "Attribute Selector"; + public static final String EXPRESSION_VALUE = "Attribute Value"; + public static final String EXPRESSION_FUNCTION = "Function"; + public static final String EXPRESSION_REFERENCE = "Varable Reference"; + public static final String EXPRESSION_DESIGNATOR = "Attribute Designator"; + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name="id") + private int id; + + //unidirectional one-to-one association to Attribute + @OneToOne + @JoinColumn(name="attribute_id") + private Attribute attribute; + + @Column(name="type", nullable=false) + private String type; + + //bi-directional many-to-one association to Obadvice + @ManyToOne + @JoinColumn(name="obadvice_id") + private Obadvice obadvice; + + public ObadviceExpression() { + type = EXPRESSION_VALUE; + } + + public int getId() { + return this.id; + } + + public void setId(int id) { + this.id = id; + } + + public Attribute getAttribute() { + return this.attribute; + } + + public void setAttribute(Attribute attribute) { + this.attribute = attribute; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public Obadvice getObadvice() { + return this.obadvice; + } + + public void setObadvice(Obadvice obadvice) { + this.obadvice = obadvice; + } + + @Override + public ObadviceExpression clone() { + ObadviceExpression expression = new ObadviceExpression(); + + expression.attribute = this.attribute; + expression.type = this.type; + expression.obadvice = this.obadvice; + + return expression; + } }