diff options
author | liamfallon <liam.fallon@est.tech> | 2019-11-07 10:38:07 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2019-11-07 10:51:33 +0000 |
commit | e4ac1ef3c51fc9afe44849ada5bea8c3d6057897 (patch) | |
tree | 51100e9b91cd1c2db2c6238625eedacab92c1aca /ONAP-REST/src/main/java/org | |
parent | f4ec47c009cdc385a7efed02dda5d26f2ec31b57 (diff) |
JUnit/SONAR/Checkstyle in ONAP-REST
Second batch of JPA pojos (B-D), with JUnit added and SONAR/Checkstyle
issues addressed. In cases where a class name change caused an update in
another package, the license header on files for those knock on changes
are not updated.
Issue-ID: POLICY-2131
Change-Id: I9466f27ffa606001209ed978be592ae95d1b32c4
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'ONAP-REST/src/main/java/org')
17 files changed, 1199 insertions, 323 deletions
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BRMSController.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BrmsController.java index af2b11a20..a17d8b643 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BRMSController.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BrmsController.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -38,117 +39,206 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; +/** + * The Class BRMSController. + */ @Entity -@Table(name="BRMSController") -@NamedQuery(name="BRMSController.findAll", query="SELECT b from BRMSController b ") -public class BRMSController implements Serializable{ +@Table(name = "BrmsController") +@NamedQuery(name = "BrmsController.findAll", query = "SELECT b from BrmsController b ") +public class BrmsController implements Serializable { private static final long serialVersionUID = -8666947569754164177L; @Id @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") + @Column(name = "id") private int id; - - @Column(name="controller_name", nullable=false, length=1024, unique=true) + + @Column(name = "controller_name", nullable = false, length = 1024, unique = true) @OrderBy("asc") private String controllerName; - - @Column(name="description", nullable=true, length=1024) + + @Column(name = "description", nullable = true, length = 1024) private String description; - + @Temporal(TemporalType.TIMESTAMP) - @Column(name="created_date", updatable=false) + @Column(name = "created_date", updatable = false) private Date createdDate; - + @ManyToOne(optional = false) - @JoinColumn(name="created_by") + @JoinColumn(name = "created_by") private UserInfo userCreatedBy; - + @Temporal(TemporalType.TIMESTAMP) - @Column(name="modified_date", nullable=false) + @Column(name = "modified_date", nullable = false) private Date modifiedDate; - + @ManyToOne(optional = false) - @JoinColumn(name="modified_by") + @JoinColumn(name = "modified_by") private UserInfo userModifiedBy; - - @Column(name="controller", nullable=false) + + @Column(name = "controller", nullable = false) private String controller; - + + /** + * Called before persisting an instance. + */ @PrePersist public void prePersist() { Date date = new Date(); this.createdDate = date; this.modifiedDate = date; } - + + /** + * Pre update. + */ @PreUpdate public void preUpdate() { this.modifiedDate = new Date(); } - + + /** + * Gets the description. + * + * @return the description + */ public String getDescription() { return description; } + /** + * Sets the description. + * + * @param description the new description + */ public void setDescription(String description) { this.description = description; } + /** + * Gets the created date. + * + * @return the created date + */ public Date getCreatedDate() { return createdDate; } + /** + * Sets the created date. + * + * @param createdDate the new created date + */ public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } + /** + * Gets the user created by. + * + * @return the user created by + */ public UserInfo getUserCreatedBy() { return userCreatedBy; } + /** + * Sets the user created by. + * + * @param userCreatedBy the new user created by + */ public void setUserCreatedBy(UserInfo userCreatedBy) { this.userCreatedBy = userCreatedBy; } + /** + * Gets the modified date. + * + * @return the modified date + */ public Date getModifiedDate() { return modifiedDate; } + /** + * Sets the modified date. + * + * @param modifiedDate the new modified date + */ public void setModifiedDate(Date modifiedDate) { this.modifiedDate = modifiedDate; } + /** + * Gets the user modified by. + * + * @return the user modified by + */ public UserInfo getUserModifiedBy() { return userModifiedBy; } + /** + * Sets the user modified by. + * + * @param userModifiedBy the new user modified by + */ public void setUserModifiedBy(UserInfo userModifiedBy) { this.userModifiedBy = userModifiedBy; } + /** + * Gets the controller. + * + * @return the controller + */ public String getController() { return controller; } + /** + * Sets the controller. + * + * @param controller the new controller + */ public void setController(String controller) { this.controller = controller; } + /** + * Gets the id. + * + * @return the id + */ public int getId() { return id; } + /** + * Sets the id. + * + * @param id the new id + */ public void setId(int id) { this.id = id; } + /** + * Gets the controller name. + * + * @return the controller name + */ public String getControllerName() { return controllerName; } + /** + * Sets the controller name. + * + * @param controllerName the new controller name + */ public void setControllerName(String controllerName) { this.controllerName = controllerName; } - + } diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BRMSDependency.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BrmsDependency.java index d06ec5d92..c04957dda 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BRMSDependency.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BrmsDependency.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -38,115 +39,204 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; +/** + * The Class BrmsDependency. + */ @Entity -@Table(name="BRMSDependency") -@NamedQuery(name="BRMSDependency.findAll", query="SELECT b from BRMSDependency b ") -public class BRMSDependency implements Serializable{ +@Table(name = "BrmsDependency") +@NamedQuery(name = "BrmsDependency.findAll", query = "SELECT b from BrmsDependency b ") +public class BrmsDependency implements Serializable { private static final long serialVersionUID = -7005622785653160761L; - + @Id @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") + @Column(name = "id") private int id; - - @Column(name="dependency_name", nullable=false, length=1024, unique=true) + + @Column(name = "dependency_name", nullable = false, length = 1024, unique = true) @OrderBy("asc") private String dependencyName; - @Column(name="description", nullable=true, length=1024) + @Column(name = "description", nullable = true, length = 1024) private String description; - + @Temporal(TemporalType.TIMESTAMP) - @Column(name="created_date", updatable=false) + @Column(name = "created_date", updatable = false) private Date createdDate; - + @ManyToOne(optional = false) - @JoinColumn(name="created_by") + @JoinColumn(name = "created_by") private UserInfo userCreatedBy; - + @Temporal(TemporalType.TIMESTAMP) - @Column(name="modified_date", nullable=false) + @Column(name = "modified_date", nullable = false) private Date modifiedDate; - + @ManyToOne(optional = false) - @JoinColumn(name="modified_by") + @JoinColumn(name = "modified_by") private UserInfo userModifiedBy; - - @Column(name="dependency", nullable=false) + + @Column(name = "dependency", nullable = false) private String dependency; - + + /** + * Pre persist. + */ @PrePersist public void prePersist() { Date date = new Date(); this.createdDate = date; this.modifiedDate = date; } - + + /** + * Pre update. + */ @PreUpdate public void preUpdate() { this.modifiedDate = new Date(); } - + + /** + * Gets the description. + * + * @return the description + */ public String getDescription() { return description; } + /** + * Sets the description. + * + * @param description the new description + */ public void setDescription(String description) { this.description = description; } + /** + * Gets the created date. + * + * @return the created date + */ public Date getCreatedDate() { return createdDate; } + /** + * Sets the created date. + * + * @param createdDate the new created date + */ public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } + /** + * Gets the user created by. + * + * @return the user created by + */ public UserInfo getUserCreatedBy() { return userCreatedBy; } + /** + * Sets the user created by. + * + * @param userCreatedBy the new user created by + */ public void setUserCreatedBy(UserInfo userCreatedBy) { this.userCreatedBy = userCreatedBy; } + /** + * Gets the modified date. + * + * @return the modified date + */ public Date getModifiedDate() { return modifiedDate; } + /** + * Sets the modified date. + * + * @param modifiedDate the new modified date + */ public void setModifiedDate(Date modifiedDate) { this.modifiedDate = modifiedDate; } + /** + * Gets the user modified by. + * + * @return the user modified by + */ public UserInfo getUserModifiedBy() { return userModifiedBy; } + /** + * Sets the user modified by. + * + * @param userModifiedBy the new user modified by + */ public void setUserModifiedBy(UserInfo userModifiedBy) { this.userModifiedBy = userModifiedBy; } + /** + * Gets the dependency. + * + * @return the dependency + */ public String getDependency() { return dependency; } + /** + * Sets the dependency. + * + * @param dependency the new dependency + */ public void setDependency(String dependency) { this.dependency = dependency; } + /** + * Gets the id. + * + * @return the id + */ public int getId() { return id; } + /** + * Sets the id. + * + * @param id the new id + */ public void setId(int id) { this.id = id; } - + + /** + * Gets the dependency name. + * + * @return the dependency name + */ public String getDependencyName() { return dependencyName; } + /** + * Sets the dependency name. + * + * @param dependencyName the new dependency name + */ public void setDependencyName(String dependencyName) { this.dependencyName = dependencyName; } diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BRMSParamTemplate.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BrmsParamTemplate.java index 7e47c0fb3..ae4fedab8 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BRMSParamTemplate.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BrmsParamTemplate.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -38,44 +39,40 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import org.onap.policy.rest.jpa.UserInfo; - /* - * JPA for the BRMS Param Template. - * + * JPA for the BRMS Param Template. + * * @version: 0.1 */ - @Entity -@Table(name="BRMSParamTemplate") -@NamedQuery(name="BRMSParamTemplate.findAll", query="SELECT b FROM BRMSParamTemplate b ") -public class BRMSParamTemplate implements Serializable{ +@Table(name = "BrmsParamTemplate") +@NamedQuery(name = "BrmsParamTemplate.findAll", query = "SELECT b FROM BrmsParamTemplate b ") +public class BrmsParamTemplate implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") + @Column(name = "id") private int id; - @Column(name="param_template_name", nullable=false, unique=true) + @Column(name = "param_template_name", nullable = false, unique = true) @OrderBy("asc") private String ruleName; @Lob - @Column(name="rule",nullable=false) + @Column(name = "rule", nullable = false) private String rule; - @Column(name="description", nullable=true, length=2048) + @Column(name = "description", nullable = true, length = 2048) private String description; @Temporal(TemporalType.TIMESTAMP) - @Column(name="created_date", updatable=false) + @Column(name = "created_date", updatable = false) private Date createdDate; - @ManyToOne(optional = false) - @JoinColumn(name="created_by") + @JoinColumn(name = "created_by") private UserInfo userCreatedBy; public UserInfo getUserCreatedBy() { @@ -87,7 +84,7 @@ public class BRMSParamTemplate implements Serializable{ } @PrePersist - public void prePersist() { + public void prePersist() { Date date = new Date(); this.createdDate = date; } @@ -100,7 +97,6 @@ public class BRMSParamTemplate implements Serializable{ this.id = id; } - public Date getCreatedDate() { return this.createdDate; } @@ -117,19 +113,19 @@ public class BRMSParamTemplate implements Serializable{ this.description = description; } - public String getRule(){ + public String getRule() { return this.rule; } - public void setRule(String rule){ + public void setRule(String rule) { this.rule = rule; } - public String getRuleName(){ + public String getRuleName() { return this.ruleName; } - public void setRuleName(String ruleName){ + public void setRuleName(String ruleName) { this.ruleName = ruleName; } } diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/Category.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/Category.java index f3874a480..4b0670752 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/Category.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/Category.java @@ -4,13 +4,14 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * Modified Copyright (C) 2018 Samsung Electronics Co., Ltd. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,6 +22,11 @@ package org.onap.policy.rest.jpa; +import com.att.research.xacml.api.Identifier; +import com.att.research.xacml.api.XACML3; +import com.att.research.xacml.std.IdentifierImpl; +import com.fasterxml.jackson.annotation.JsonBackReference; + import java.io.Serializable; import java.util.HashSet; import java.util.Set; @@ -35,19 +41,13 @@ import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Transient; -import com.att.research.xacml.api.Identifier; -import com.att.research.xacml.api.XACML3; -import com.att.research.xacml.std.IdentifierImpl; -import com.fasterxml.jackson.annotation.JsonBackReference; - - /** * The persistent class for the Categories database table. - * + * */ @Entity -@Table(name="Category") -@NamedQuery(name="Category.findAll", query="SELECT c FROM Category c") +@Table(name = "Category") +@NamedQuery(name = "Category.findAll", query = "SELECT c FROM Category c") public class Category implements Serializable { private static final long serialVersionUID = 1L; @@ -56,26 +56,29 @@ public class Category implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") + @Column(name = "id") private int id; - @Column(name="grouping", nullable=false, length=64) + @Column(name = "grouping", nullable = false, length = 64) private String grouping; - @Column(name="is_standard", nullable=false) + @Column(name = "is_standard", nullable = false) private char isStandard; - @Column(name="xacml_id", nullable=false, unique=true, length=255) + @Column(name = "xacml_id", nullable = false, unique = true, length = 255) private String xacmlId; - @Column(name="short_name", nullable=false, length=64) + @Column(name = "short_name", nullable = false, length = 64) private String shortName; - //bi-directional many-to-one association to Attribute - @OneToMany(mappedBy="categoryBean") + // bi-directional many-to-one association to Attribute + @OneToMany(mappedBy = "categoryBean") @JsonBackReference private Set<Attribute> attributes = new HashSet<>(); + /** + * Instantiates a new category. + */ public Category() { this.xacmlId = XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT.stringValue(); this.grouping = "subject"; @@ -83,6 +86,13 @@ public class Category implements Serializable { this.shortName = "subject"; } + /** + * Instantiates a new category. + * + * @param cat the cat + * @param grouping the grouping + * @param isStandard the is standard + */ public Category(Identifier cat, String grouping, char isStandard) { if (cat != null) { this.xacmlId = cat.stringValue(); @@ -95,66 +105,149 @@ public class Category implements Serializable { } } + /** + * Instantiates a new category. + * + * @param cat the cat + * @param grouping the grouping + */ public Category(Identifier cat, String grouping) { this(cat, grouping, Category.STANDARD); } + /** + * Instantiates a new category. + * + * @param cat the cat + * @param standard the standard + */ public Category(Identifier cat, char standard) { this(cat, null, standard); } + /** + * Instantiates a new category. + * + * @param cat the cat + */ public Category(Identifier cat) { this(cat, Category.STANDARD); } + /** + * Gets the id. + * + * @return the id + */ public int getId() { return this.id; } + /** + * Sets the id. + * + * @param id the new id + */ public void setId(int id) { this.id = id; } + /** + * Gets the grouping. + * + * @return the grouping + */ public String getGrouping() { return this.grouping; } + /** + * Sets the grouping. + * + * @param grouping the new grouping + */ public void setGrouping(String grouping) { this.grouping = grouping; } + /** + * Gets the checks if is standard. + * + * @return the checks if is standard + */ public char getIsStandard() { return this.isStandard; } + /** + * Sets the checks if is standard. + * + * @param isStandard the new checks if is standard + */ public void setIsStandard(char isStandard) { this.isStandard = isStandard; } + /** + * Gets the xacml id. + * + * @return the xacml id + */ public String getXacmlId() { return this.xacmlId; } + /** + * Sets the xacml id. + * + * @param xacmlId the new xacml id + */ public void setXacmlId(String xacmlId) { this.xacmlId = xacmlId; } + /** + * Gets the short name. + * + * @return the short name + */ public String getShortName() { return this.shortName; } + /** + * Sets the short name. + * + * @param shortName the new short name + */ public void setShortName(String shortName) { this.shortName = shortName; } + /** + * Gets the attributes. + * + * @return the attributes + */ public Set<Attribute> getAttributes() { return this.attributes; } + /** + * Sets the attributes. + * + * @param attributes the new attributes + */ public void setAttributes(Set<Attribute> attributes) { this.attributes = attributes; } + /** + * Adds the attribute. + * + * @param attribute the attribute + * @return the attribute + */ public Attribute addAttribute(Attribute attribute) { getAttributes().add(attribute); attribute.setCategoryBean(this); @@ -162,6 +255,12 @@ public class Category implements Serializable { return attribute; } + /** + * Removes the attribute. + * + * @param attribute the attribute + * @return the attribute + */ public Attribute removeAttribute(Attribute attribute) { getAttributes().remove(attribute); attribute.setCategoryBean(null); @@ -169,30 +268,41 @@ public class Category implements Serializable { return attribute; } + /** + * Checks if is standard. + * + * @return true, if is standard + */ @Transient public boolean isStandard() { return this.isStandard == Category.STANDARD; } + /** + * Checks if is custom. + * + * @return true, if is custom + */ @Transient public boolean isCustom() { return this.isStandard == Category.CUSTOM; } + /** + * Extract grouping. + * + * @param xacmlId the xacml id + * @return the string + */ @Transient - public static String extractGrouping(String xacmlId) { + public static String extractGrouping(String xacmlId) { if (xacmlId == null) { return null; } String[] parts = xacmlId.split("[:]"); - if (xacmlId.matches(".*:attribute\\-category:.*")) { - if (parts.length > 0) { - return parts[parts.length - 1]; - } - } else if (xacmlId.matches(".*:[a-zA-Z]+[\\-]category:.*")) { - if (parts.length <= 0) { - return null; - } + if (xacmlId.matches(".*:attribute\\-category:.*")) { + return parts[parts.length - 1]; + } else if (xacmlId.matches(".*:[a-zA-Z]+[\\-]category:.*")) { for (String part : parts) { int index = part.indexOf("-category"); if (index > 0) { @@ -203,17 +313,26 @@ public class Category implements Serializable { return null; } + /** + * Gets the identifer. + * + * @return the identifer + */ @Transient public Identifier getIdentifer() { return new IdentifierImpl(this.xacmlId); } + /** + * To string. + * + * @return the string + */ @Transient @Override public String toString() { - return "Category [id=" + id + ", grouping=" + grouping - + ", isStandard=" + isStandard + ", xacmlId=" + xacmlId - + ", attributes=" + attributes + "]"; + return "Category [id=" + id + ", grouping=" + grouping + ", isStandard=" + isStandard + ", xacmlId=" + xacmlId + + ", attributes=" + attributes + "]"; } } diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoopD2Services.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoopD2Services.java index cd2ea591d..4f6b1d7cb 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoopD2Services.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoopD2Services.java @@ -3,6 +3,7 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +20,13 @@ */ package org.onap.policy.rest.jpa; + /* * */ import java.io.Serializable; import java.util.Date; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -39,110 +42,190 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; - +/** + * The Class ClosedLoopD2Services. + */ @Entity @Table(name = "ClosedLoopD2Services") -@NamedQuery(name="ClosedLoopD2Services.findAll", query="SELECT c FROM ClosedLoopD2Services c ") -public class ClosedLoopD2Services implements Serializable{ +@NamedQuery(name = "ClosedLoopD2Services.findAll", query = "SELECT c FROM ClosedLoopD2Services c ") +public class ClosedLoopD2Services implements Serializable { private static final long serialVersionUID = 1L; @Id - @Column(name ="id") + @Column(name = "id") @GeneratedValue(strategy = GenerationType.AUTO) private int id; - @Column(name="service_Name", nullable=false, unique=true) + @Column(name = "service_Name", nullable = false, unique = true) @OrderBy("asc") private String serviceName; - @Column(name="description", nullable=true, length=2048) + @Column(name = "description", nullable = true, length = 2048) private String description; @Temporal(TemporalType.TIMESTAMP) - @Column(name="created_date", updatable=false) + @Column(name = "created_date", updatable = false) private Date createdDate; @Temporal(TemporalType.TIMESTAMP) - @Column(name="modified_date", nullable=false) + @Column(name = "modified_date", nullable = false) private Date modifiedDate; @ManyToOne(optional = false) - @JoinColumn(name="created_by") + @JoinColumn(name = "created_by") private UserInfo userCreatedBy; @ManyToOne(optional = false) - @JoinColumn(name="modified_by") + @JoinColumn(name = "modified_by") private UserInfo userModifiedBy; + /** + * Instantiates a new closed loop D 2 services. + */ public ClosedLoopD2Services() { this.setModifiedDate(new Date()); } - + /** + * Gets the user created by. + * + * @return the user created by + */ public UserInfo getUserCreatedBy() { return userCreatedBy; } + /** + * Sets the user created by. + * + * @param userCreatedBy the new user created by + */ public void setUserCreatedBy(UserInfo userCreatedBy) { this.userCreatedBy = userCreatedBy; } + /** + * Gets the user modified by. + * + * @return the user modified by + */ public UserInfo getUserModifiedBy() { return userModifiedBy; } + /** + * Sets the user modified by. + * + * @param userModifiedBy the new user modified by + */ public void setUserModifiedBy(UserInfo userModifiedBy) { this.userModifiedBy = userModifiedBy; } + /** + * Pre persist. + */ @PrePersist - public void prePersist() { + public void prePersist() { Date date = new Date(); this.createdDate = date; this.modifiedDate = date; } + /** + * Pre update. + */ @PreUpdate public void preUpdate() { this.modifiedDate = new Date(); } + /** + * Gets the id. + * + * @return the id + */ public int getId() { return id; } + /** + * Sets the id. + * + * @param id the new id + */ public void setId(int id) { this.id = id; } + /** + * Gets the service name. + * + * @return the service name + */ public String getServiceName() { return serviceName; } + /** + * Sets the service name. + * + * @param serviceName the new service name + */ public void setServiceName(String serviceName) { this.serviceName = serviceName; } + /** + * Gets the description. + * + * @return the description + */ public String getDescription() { return description; } + /** + * Sets the description. + * + * @param description the new description + */ public void setDescription(String description) { this.description = description; } + /** + * Gets the created date. + * + * @return the created date + */ public Date getCreatedDate() { return createdDate; } + /** + * Sets the created date. + * + * @param createdDate the new created date + */ public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } + /** + * Gets the modified date. + * + * @return the modified date + */ public Date getModifiedDate() { return modifiedDate; } + /** + * Sets the modified date. + * + * @param modifiedDate the new modified date + */ public void setModifiedDate(Date modifiedDate) { this.modifiedDate = modifiedDate; } diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoopSite.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoopSite.java index 52b5a2a4a..fc8801042 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoopSite.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoopSite.java @@ -3,6 +3,7 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +26,7 @@ package org.onap.policy.rest.jpa; */ import java.io.Serializable; import java.util.Date; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -40,111 +42,190 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; - +/** + * The Class ClosedLoopSite. + */ @Entity @Table(name = "ClosedLoopSite") -@NamedQuery(name="ClosedLoopSite.findAll", query="SELECT c FROM ClosedLoopSite c ") -public class ClosedLoopSite implements Serializable{ +@NamedQuery(name = "ClosedLoopSite.findAll", query = "SELECT c FROM ClosedLoopSite c ") +public class ClosedLoopSite implements Serializable { private static final long serialVersionUID = 1L; - @Id - @Column(name ="id") + @Column(name = "id") @GeneratedValue(strategy = GenerationType.AUTO) private int id; - @Column(name="site_Name", nullable=false, unique=true) + @Column(name = "site_Name", nullable = false, unique = true) @OrderBy("asc") private String siteName; - @Column(name="description", nullable=true, length=2048) + @Column(name = "description", nullable = true, length = 2048) private String description; @Temporal(TemporalType.TIMESTAMP) - @Column(name="created_date", updatable=false) + @Column(name = "created_date", updatable = false) private Date createdDate; @Temporal(TemporalType.TIMESTAMP) - @Column(name="modified_date", nullable=false) + @Column(name = "modified_date", nullable = false) private Date modifiedDate; @ManyToOne(optional = false) - @JoinColumn(name="created_by") + @JoinColumn(name = "created_by") private UserInfo userCreatedBy; @ManyToOne(optional = false) - @JoinColumn(name="modified_by") + @JoinColumn(name = "modified_by") private UserInfo userModifiedBy; + /** + * Instantiates a new closed loop site. + */ public ClosedLoopSite() { this.setModifiedDate(new Date()); } - + /** + * Gets the user created by. + * + * @return the user created by + */ public UserInfo getUserCreatedBy() { return userCreatedBy; } + /** + * Sets the user created by. + * + * @param userCreatedBy the new user created by + */ public void setUserCreatedBy(UserInfo userCreatedBy) { this.userCreatedBy = userCreatedBy; } + /** + * Gets the user modified by. + * + * @return the user modified by + */ public UserInfo getUserModifiedBy() { return userModifiedBy; } + /** + * Sets the user modified by. + * + * @param userModifiedBy the new user modified by + */ public void setUserModifiedBy(UserInfo userModifiedBy) { this.userModifiedBy = userModifiedBy; } + /** + * Pre persist. + */ @PrePersist - public void prePersist() { + public void prePersist() { Date date = new Date(); this.createdDate = date; this.modifiedDate = date; } + /** + * Pre update. + */ @PreUpdate public void preUpdate() { this.modifiedDate = new Date(); } + /** + * Gets the id. + * + * @return the id + */ public int getId() { return id; } + /** + * Sets the id. + * + * @param id the new id + */ public void setId(int id) { this.id = id; } + /** + * Gets the site name. + * + * @return the site name + */ public String getSiteName() { return siteName; } + /** + * Sets the site name. + * + * @param siteName the new site name + */ public void setSiteName(String siteName) { this.siteName = siteName; } + /** + * Gets the description. + * + * @return the description + */ public String getDescription() { return description; } + /** + * Sets the description. + * + * @param description the new description + */ public void setDescription(String description) { this.description = description; } + /** + * Gets the created date. + * + * @return the created date + */ public Date getCreatedDate() { return createdDate; } + /** + * Sets the created date. + * + * @param createdDate the new created date + */ public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } + /** + * Gets the modified date. + * + * @return the modified date + */ public Date getModifiedDate() { return modifiedDate; } + /** + * Sets the modified date. + * + * @param modifiedDate the new modified date + */ public void setModifiedDate(Date modifiedDate) { this.modifiedDate = modifiedDate; } diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoops.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoops.java index 721a2c5f4..edeabce4b 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoops.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoops.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,35 +34,30 @@ import javax.persistence.OrderBy; import javax.persistence.Table; @Entity -@Table(name="ClosedLoops") -@NamedQueries({ - @NamedQuery(name="ClosedLoops.findAll", query="SELECT e FROM ClosedLoops e"), - @NamedQuery(name="ClosedLoops.deleteAll", query="DELETE FROM ClosedLoops WHERE 1=1") -}) +@Table(name = "ClosedLoops") +@NamedQueries( + { @NamedQuery(name = "ClosedLoops.findAll", query = "SELECT e FROM ClosedLoops e"), + @NamedQuery(name = "ClosedLoops.deleteAll", query = "DELETE FROM ClosedLoops WHERE 1=1") }) public class ClosedLoops implements Serializable { - - /** - * - */ private static final long serialVersionUID = -7796845092457926842L; @Id @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") + @Column(name = "id") private int id; - @Column(name="closedLoopControlName", nullable=false, length=255) + @Column(name = "closedLoopControlName", nullable = false, length = 255) @OrderBy("asc") private String closedLoopControlName; - @Column(name="alarmConditions", nullable=true, length=255) + @Column(name = "alarmConditions", nullable = true, length = 255) private String alarmConditions; - @Column(name="yaml", nullable=true, length=1028) + @Column(name = "yaml", nullable = true, length = 1028) private String yaml; public ClosedLoops() { - //An empty constructor + // An empty constructor } public int getId() { diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConfigurationDataEntity.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConfigurationDataEntity.java index 7bb73f36a..8fd839a18 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConfigurationDataEntity.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConfigurationDataEntity.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,11 +20,13 @@ */ package org.onap.policy.rest.jpa; + +import com.fasterxml.jackson.annotation.JsonBackReference; + /* */ import java.io.Serializable; import java.util.Date; -import java.util.Objects; import javax.persistence.Column; import javax.persistence.Entity; @@ -43,168 +46,238 @@ import javax.persistence.Version; * The Entity class to persist a policy object configuration data */ +import lombok.EqualsAndHashCode; -import com.fasterxml.jackson.annotation.JsonBackReference; - +/** + * The Class ConfigurationDataEntity. + */ +// @formatter:off @Entity -@Table(name="ConfigurationDataEntity") -@NamedQueries({ - @NamedQuery(name="ConfigurationDataEntity.findAll", query="SELECT e FROM ConfigurationDataEntity e "), - @NamedQuery(name="ConfigurationDataEntity.deleteAll", query="DELETE FROM ConfigurationDataEntity WHERE 1=1") -}) +@Table(name = "ConfigurationDataEntity") +@NamedQueries( + { + @NamedQuery(name = "ConfigurationDataEntity.findAll", query = "SELECT e FROM ConfigurationDataEntity e "), + @NamedQuery(name = "ConfigurationDataEntity.deleteAll", query = "DELETE FROM ConfigurationDataEntity WHERE 1=1") + } +) +@EqualsAndHashCode +//@formatter:on public class ConfigurationDataEntity implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="configurationDataId") + @Column(name = "configurationDataId") @JsonBackReference private long configurationDataId; - @Column(name="configurationName", nullable=false, length=255) + @Column(name = "configurationName", nullable = false, length = 255) private String configurationName = ""; @Version - @Column(name="version") + @Column(name = "version") private int version; - @Column(name="configType", nullable=false, length=255) + @Column(name = "configType", nullable = false, length = 255) private String configType = "NoType"; @Lob - @Column(name="configBody", nullable=false, columnDefinition="TEXT") + @Column(name = "configBody", nullable = false, columnDefinition = "TEXT") private String configBody = "NoBody"; - @Column(name="created_by", nullable=false, length=255) + @Column(name = "created_by", nullable = false, length = 255) private String createdBy = "guest"; @Temporal(TemporalType.TIMESTAMP) - @Column(name="created_date", updatable=false) + @Column(name = "created_date", updatable = false) private Date createdDate; - @Column(name="description", nullable=false, length=2048) + @Column(name = "description", nullable = false, length = 2048) private String description = "NoDescription"; - @Column(name="modified_by", nullable=false, length=255) + @Column(name = "modified_by", nullable = false, length = 255) private String modifiedBy = "guest"; @Temporal(TemporalType.TIMESTAMP) - @Column(name="modified_date", nullable=false) + @Column(name = "modified_date", nullable = false) private Date modifiedDate; - @Column(name="deleted", nullable=false) + @Column(name = "deleted", nullable = false) private boolean deleted = false; + /** + * Instantiates a new configuration data entity. + */ public ConfigurationDataEntity() { - //An empty constructor + // An empty constructor } + /** + * Pre persist. + */ @PrePersist - public void prePersist() { + public void prePersist() { Date date = new Date(); this.createdDate = date; this.modifiedDate = date; } + /** + * Pre update. + */ @PreUpdate public void preUpdate() { this.modifiedDate = new Date(); } + /** + * Gets the configuration data id. + * * @return the configurationDataId */ public long getConfigurationDataId() { return configurationDataId; } + /** - * @param configurationDataId the configurationDataId to set + * Sets the configuration name. + * + * @param configurationName the new configuration name */ public void setConfigurationName(String configurationName) { this.configurationName = configurationName; } - public String getConfigurationName(){ + + /** + * Gets the configuration name. + * + * @return the configuration name + */ + public String getConfigurationName() { return this.configurationName; } + /** + * Gets the config type. + * * @return the configType */ public String getConfigType() { return configType; } + /** + * Sets the config type. + * * @param configType the configType to set */ public void setConfigType(String configType) { this.configType = configType; } + /** + * Gets the config body. + * * @return the configBody */ public String getConfigBody() { return configBody; } + /** + * Sets the config body. + * * @param configBody the configBody to set */ public void setConfigBody(String configBody) { this.configBody = configBody; } + /** + * Gets the created by. + * * @return the createdBy */ public String getCreatedBy() { return createdBy; } + /** + * Sets the created by. + * * @param createdBy the createdBy to set */ public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } + /** + * Gets the description. + * * @return the description */ public String getDescription() { return description; } + /** + * Sets the description. + * * @param description the description to set */ public void setDescription(String description) { this.description = description; } + /** + * Gets the modified by. + * * @return the modifiedBy */ public String getModifiedBy() { return modifiedBy; } + /** + * Sets the modified by. + * * @param modifiedBy the modifiedBy to set */ public void setModifiedBy(String modifiedBy) { this.modifiedBy = modifiedBy; } + /** + * Gets the modified date. + * * @return the modifiedDate */ public Date getModifiedDate() { return modifiedDate; } + /** + * Sets the modified date. + * * @param modifiedDate the modifiedDate to set */ public void setModifiedDate(Date modifiedDate) { this.modifiedDate = modifiedDate; } + /** + * Gets the version. + * * @return the version */ public int getVersion() { return version; } + /** + * Gets the created date. + * * @return the createdDate */ public Date getCreatedDate() { @@ -212,6 +285,8 @@ public class ConfigurationDataEntity implements Serializable { } /** + * Checks if is deleted. + * * @return the deleted */ public boolean isDeleted() { @@ -219,40 +294,11 @@ public class ConfigurationDataEntity implements Serializable { } /** + * Sets the deleted. + * * @param deleted the deleted to set */ public void setDeleted(boolean deleted) { this.deleted = deleted; } - - @Override - public int hashCode() { - return Objects.hash(configurationDataId, configurationName, version, configType, - configBody, createdBy, createdDate, description, modifiedBy, modifiedDate, deleted); - } - - @Override - public boolean equals(Object obj) { - if(obj == null){ - return false; - } - if(obj == this){ - return true; - } - if(!(obj instanceof ConfigurationDataEntity)){ - return false; - } - - return configurationDataId == ((ConfigurationDataEntity) obj).configurationDataId && - configurationName.equals(((ConfigurationDataEntity) obj).configurationName) && - version == ((ConfigurationDataEntity) obj).version && - configType.equals(((ConfigurationDataEntity) obj).configType) && - configBody.equals(((ConfigurationDataEntity) obj).configBody) && - createdBy.equals(((ConfigurationDataEntity) obj).createdBy) && - createdDate.equals(((ConfigurationDataEntity) obj).createdDate) && - description.equals(((ConfigurationDataEntity) obj).description) && - modifiedBy.equals(((ConfigurationDataEntity) obj).modifiedBy) && - modifiedDate.equals(((ConfigurationDataEntity) obj).modifiedDate) && - deleted == ((ConfigurationDataEntity) obj).deleted; - } } diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConstraintType.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConstraintType.java index 606403318..f7637013b 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConstraintType.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConstraintType.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -36,8 +37,8 @@ import javax.persistence.OneToMany; import javax.persistence.Table; @Entity -@Table(name="ConstraintType") -@NamedQuery(name="ConstraintType.findAll", query="SELECT a FROM ConstraintType a") +@Table(name = "ConstraintType") +@NamedQuery(name = "ConstraintType.findAll", query = "SELECT a FROM ConstraintType a") public class ConstraintType implements Serializable { private static final long serialVersionUID = 1L; @@ -46,30 +47,36 @@ public class ConstraintType implements Serializable { public static final String REGEXP_TYPE = "Regular Expression"; protected static final Map<String, String> defaults = new HashMap<>(); + static { - defaults.put(ENUMERATION_TYPE, "Enumerate a set of values that the attribute may be set to during policy creation."); - defaults.put(RANGE_TYPE, "Set a range of min and/or max integer/double values the attribute can be set to during policy creation."); - defaults.put(REGEXP_TYPE, "Define a regular expression the attribute must match against during policy creation."); + defaults.put(ENUMERATION_TYPE, + "Enumerate a set of values that the attribute may be set to during policy creation."); + defaults.put(RANGE_TYPE, "Set a range of min and/or max integer/double values " + + "the attribute can be set to during policy creation."); + defaults.put(REGEXP_TYPE, + "Define a regular expression the attribute must match against during policy creation."); } - private static final String[] RANGE_TYPES = {"minExclusive", "minInclusive", "maxExclusive", "maxInclusive"}; + + private static final String[] RANGE_TYPES = + { "minExclusive", "minInclusive", "maxExclusive", "maxInclusive" }; @Id @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") + @Column(name = "id") private int id; - @Column(name="constraint_type", nullable=false, length=64) + @Column(name = "constraint_type", nullable = false, length = 64) private String constraintType; - @Column(name="description", nullable=false, length=255) + @Column(name = "description", nullable = false, length = 255) private String description; - //bi-directional many-to-one association to Attribute - @OneToMany(mappedBy="constraintType") + // bi-directional many-to-one association to Attribute + @OneToMany(mappedBy = "constraintType") private Set<Attribute> attributes = new HashSet<>(); public ConstraintType() { - //An empty constructor + // An empty constructor } public ConstraintType(String constraintType) { diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConstraintValue.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConstraintValue.java index 4c3bf6609..c30af1fd6 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConstraintValue.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConstraintValue.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -32,35 +33,34 @@ import javax.persistence.ManyToOne; import javax.persistence.NamedQuery; import javax.persistence.Table; - /** * The persistent class for the ConstraintValues database table. - * + * */ @Entity -@Table(name="ConstraintValues") -@NamedQuery(name="ConstraintValue.findAll", query="SELECT c FROM ConstraintValue c") +@Table(name = "ConstraintValues") +@NamedQuery(name = "ConstraintValue.findAll", query = "SELECT c FROM ConstraintValue c") public class ConstraintValue implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") + @Column(name = "id") private int id; - @Column(name="property") + @Column(name = "property") private String property; - @Column(name="value") + @Column(name = "value") private String value; - //bi-directional many-to-one association to Attribute + // bi-directional many-to-one association to Attribute @ManyToOne - @JoinColumn(name="attribute_id") + @JoinColumn(name = "attribute_id") private Attribute attribute; public ConstraintValue() { - //An empty constructor + // An empty constructor } public ConstraintValue(String property, String value) { diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DatabaseLockEntity.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DatabaseLockEntity.java index b82ec4882..73d2c99f9 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DatabaseLockEntity.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DatabaseLockEntity.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,20 +29,23 @@ import javax.persistence.Id; import javax.persistence.Table; @Entity -@Table(name="DatabaseLockEntity") +@Table(name = "DatabaseLockEntity") public class DatabaseLockEntity implements Serializable { private static final long serialVersionUID = 1L; @Id - @Column(name="lock_key") - private int lock_key = 1; - public DatabaseLockEntity(){ - //An empty constructor + @Column(name = "lock_key") + private int lockKey = 1; + + public DatabaseLockEntity() { + // An empty constructor } - public int getKey(){ - return lock_key; + + public int getKey() { + return lockKey; } - public void setKey(int key){ - this.lock_key = key; + + public void setKey(int key) { + this.lockKey = key; } } diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/Datatype.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/Datatype.java index 4ab577976..9da83ffb2 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/Datatype.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/Datatype.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,6 +21,12 @@ package org.onap.policy.rest.jpa; +import com.att.research.xacml.api.Identifier; +import com.att.research.xacml.api.XACML3; +import com.att.research.xacml.std.IdentifierImpl; +import com.fasterxml.jackson.annotation.JsonBackReference; +import com.fasterxml.jackson.annotation.JsonIgnore; + import java.io.Serializable; import java.util.HashSet; import java.util.Set; @@ -34,20 +41,13 @@ import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Transient; -import com.att.research.xacml.api.Identifier; -import com.att.research.xacml.api.XACML3; -import com.att.research.xacml.std.IdentifierImpl; -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIgnore; - - /** * The persistent class for the Datatype database table. - * + * */ @Entity -@Table(name="Datatype") -@NamedQuery(name="Datatype.findAll", query="SELECT d FROM Datatype d") +@Table(name = "Datatype") +@NamedQuery(name = "Datatype.findAll", query = "SELECT d FROM Datatype d") public class Datatype implements Serializable { private static final long serialVersionUID = 1L; @@ -56,39 +56,47 @@ public class Datatype implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") + @Column(name = "id") private int id; - @Column(name="is_standard", nullable=false) + @Column(name = "is_standard", nullable = false) private char isStandard; - @Column(name="xacml_id", nullable=false, unique=true, length=255) + @Column(name = "xacml_id", nullable = false, unique = true, length = 255) private String xacmlId; - @Column(name="short_name", nullable=false, length=64) + @Column(name = "short_name", nullable = false, length = 64) private String shortName; - //bi-directional many-to-one association to Attribute - @OneToMany(mappedBy="datatypeBean") + // bi-directional many-to-one association to Attribute + @OneToMany(mappedBy = "datatypeBean") @JsonBackReference private Set<Attribute> attributes = new HashSet<>(); - //bi-directional many-to-one association to Attribute - @OneToMany(mappedBy="datatypeBean") + // bi-directional many-to-one association to Attribute + @OneToMany(mappedBy = "datatypeBean") @JsonIgnore private Set<FunctionDefinition> functions = new HashSet<>(); - //bi-directional many-to-one association to Attribute - @OneToMany(mappedBy="datatypeBean") + // bi-directional many-to-one association to Attribute + @OneToMany(mappedBy = "datatypeBean") @JsonIgnore private Set<FunctionArgument> arguments = new HashSet<>(); + /** + * Instantiates a new datatype. + */ public Datatype() { this.xacmlId = XACML3.ID_DATATYPE_STRING.stringValue(); this.isStandard = Datatype.STANDARD; } - + /** + * Instantiates a new datatype. + * + * @param id the id + * @param dt the dt + */ public Datatype(int id, Datatype dt) { this.id = id; this.isStandard = dt.isStandard; @@ -100,6 +108,12 @@ public class Datatype implements Serializable { this.attributes = new HashSet<>(); } + /** + * Instantiates a new datatype. + * + * @param identifier the identifier + * @param standard the standard + */ public Datatype(Identifier identifier, char standard) { if (identifier != null) { this.xacmlId = identifier.stringValue(); @@ -108,50 +122,111 @@ public class Datatype implements Serializable { this.isStandard = standard; } + /** + * Instantiates a new datatype. + * + * @param identifier the identifier + */ public Datatype(Identifier identifier) { this(identifier, Datatype.STANDARD); } + /** + * Gets the id. + * + * @return the id + */ public int getId() { return this.id; } + /** + * Sets the id. + * + * @param id the new id + */ public void setId(int id) { this.id = id; } + /** + * Gets the checks if is standard. + * + * @return the checks if is standard + */ public char getIsStandard() { return this.isStandard; } + /** + * Sets the checks if is standard. + * + * @param isStandard the new checks if is standard + */ public void setIsStandard(char isStandard) { this.isStandard = isStandard; } + /** + * Gets the xacml id. + * + * @return the xacml id + */ public String getXacmlId() { return this.xacmlId; } + /** + * Sets the xacml id. + * + * @param xacmlId the new xacml id + */ public void setXacmlId(String xacmlId) { this.xacmlId = xacmlId; } + /** + * Gets the short name. + * + * @return the short name + */ public String getShortName() { return shortName; } + /** + * Sets the short name. + * + * @param shortName the new short name + */ public void setShortName(String shortName) { this.shortName = shortName; } + /** + * Gets the attributes. + * + * @return the attributes + */ public Set<Attribute> getAttributes() { return this.attributes; } + /** + * Sets the attributes. + * + * @param attributes the new attributes + */ public void setAttributes(Set<Attribute> attributes) { this.attributes = attributes; } + /** + * Adds the attribute. + * + * @param attribute the attribute + * @return the attribute + */ public Attribute addAttribute(Attribute attribute) { getAttributes().add(attribute); attribute.setDatatypeBean(this); @@ -159,6 +234,12 @@ public class Datatype implements Serializable { return attribute; } + /** + * Removes the attribute. + * + * @param attribute the attribute + * @return the attribute + */ public Attribute removeAttribute(Attribute attribute) { getAttributes().remove(attribute); attribute.setDatatypeBean(null); @@ -166,14 +247,43 @@ public class Datatype implements Serializable { return attribute; } + /** + * Removes the attribute. + * + * @param function the function + * @return the function definition + */ + public FunctionDefinition removeAttribute(FunctionDefinition function) { + getFunctions().remove(function); + function.setDatatypeBean(null); + + return function; + } + + /** + * Gets the functions. + * + * @return the functions + */ public Set<FunctionDefinition> getFunctions() { return this.functions; } + /** + * Sets the functions. + * + * @param functions the new functions + */ public void setFunctions(Set<FunctionDefinition> functions) { this.functions = functions; } + /** + * Adds the function. + * + * @param function the function + * @return the function definition + */ public FunctionDefinition addFunction(FunctionDefinition function) { getFunctions().add(function); function.setDatatypeBean(this); @@ -181,21 +291,30 @@ public class Datatype implements Serializable { return function; } - public FunctionDefinition removeAttribute(FunctionDefinition function) { - getFunctions().remove(function); - function.setDatatypeBean(null); - - return function; - } - + /** + * Gets the arguments. + * + * @return the arguments + */ public Set<FunctionArgument> getArguments() { return this.arguments; } + /** + * Sets the arguments. + * + * @param argument the new arguments + */ public void setArguments(Set<FunctionArgument> argument) { this.arguments = argument; } + /** + * Adds the argument. + * + * @param argument the argument + * @return the function argument + */ public FunctionArgument addArgument(FunctionArgument argument) { getArguments().add(argument); argument.setDatatypeBean(this); @@ -203,6 +322,12 @@ public class Datatype implements Serializable { return argument; } + /** + * Removes the argument. + * + * @param argument the argument + * @return the function argument + */ public FunctionArgument removeArgument(FunctionArgument argument) { getArguments().remove(argument); argument.setDatatypeBean(null); @@ -210,33 +335,56 @@ public class Datatype implements Serializable { return argument; } + /** + * Gets the identifer. + * + * @return the identifer + */ @Transient public Identifier getIdentifer() { return new IdentifierImpl(this.xacmlId); } + /** + * Gets the identifer by short name. + * + * @return the identifer by short name + */ @Transient public Identifier getIdentiferByShortName() { return new IdentifierImpl(this.shortName); } + /** + * Checks if is standard. + * + * @return true, if is standard + */ @Transient public boolean isStandard() { return this.isStandard == Datatype.STANDARD; } + /** + * Checks if is custom. + * + * @return true, if is custom + */ @Transient public boolean isCustom() { return this.isStandard == Datatype.CUSTOM; } + /** + * To string. + * + * @return the string + */ @Transient @Override public String toString() { - return "Datatype [id=" + id + ", isStandard=" + isStandard - + ", xacmlId=" + xacmlId + ", shortName=" + shortName - + ", attributes=" + attributes + ", functions=" + functions - + ", arguments=" + arguments + "]"; + return "Datatype [id=" + id + ", isStandard=" + isStandard + ", xacmlId=" + xacmlId + ", shortName=" + shortName + + ", attributes=" + attributes + ", functions=" + functions + ", arguments=" + arguments + "]"; } } diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DCAEUsers.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DcaeUsers.java index 31dd66056..1408c9fd4 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DCAEUsers.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DcaeUsers.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,6 +20,7 @@ */ package org.onap.policy.rest.jpa; + /* */ import java.io.Serializable; @@ -32,24 +34,23 @@ import javax.persistence.NamedQuery; import javax.persistence.OrderBy; import javax.persistence.Table; - @Entity -@Table(name="DCAEUsers") -@NamedQuery(name="DCAEUsers.findAll", query="SELECT e FROM DCAEUsers e ") -public class DCAEUsers implements Serializable { +@Table(name = "DcaeUsers") +@NamedQuery(name = "DcaeUsers.findAll", query = "SELECT e FROM DcaeUsers e ") +public class DcaeUsers implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") + @Column(name = "id") private int id; - @Column(name="name", nullable=false) + @Column(name = "name", nullable = false) @OrderBy("asc") private String name; - @Column(name="description ") - private String description ; + @Column(name = "description ") + private String description; public int getId() { return this.id; @@ -58,6 +59,7 @@ public class DCAEUsers implements Serializable { public void setId(int id) { this.id = id; } + public String getName() { return this.name; } @@ -66,12 +68,13 @@ public class DCAEUsers implements Serializable { this.name = name; } + public String getDescriptionValue() { - return this.description ; + return this.description; } - public void setDescriptionValue(String description ) { - this.description = description ; + public void setDescriptionValue(String description) { + this.description = description; } } diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DCAEuuid.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DcaeUuid.java index 5194093d1..8464ef7e8 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DCAEuuid.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DcaeUuid.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,6 +20,7 @@ */ package org.onap.policy.rest.jpa; + /* */ import java.io.Serializable; @@ -32,23 +34,22 @@ import javax.persistence.NamedQuery; import javax.persistence.OrderBy; import javax.persistence.Table; - @Entity -@Table(name="DCAEuuid") -@NamedQuery(name="DCAEuuid.findAll", query="SELECT e FROM DCAEuuid e ") -public class DCAEuuid implements Serializable { +@Table(name = "DcaeUuid") +@NamedQuery(name = "DcaeUuid.findAll", query = "SELECT e FROM DcaeUuid e ") +public class DcaeUuid implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") + @Column(name = "id") private int id; - @Column(name="name", nullable=false) + @Column(name = "name", nullable = false) @OrderBy("asc") private String name; - @Column(name="description") + @Column(name = "description") private String description; public String getDescription() { @@ -66,6 +67,7 @@ public class DCAEuuid implements Serializable { public void setId(int id) { this.id = id; } + public String getName() { return this.name; } diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DecisionSettings.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DecisionSettings.java index e469c0b4f..693641e43 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DecisionSettings.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DecisionSettings.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -39,40 +40,47 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.Transient; - +/** + * The Class DecisionSettings. + */ +// @formatter:off @Entity -@Table(name="DecisionSettings") -@NamedQuery(name="DecisionSettings.findAll", query="SELECT a FROM DecisionSettings a order by a.priority asc, a.xacmlId asc") +@Table(name = "DecisionSettings") +@NamedQuery( + name = "DecisionSettings.findAll", + query = "SELECT a FROM DecisionSettings a order by a.priority asc, a.xacmlId asc" +) +//@formatter:on public class DecisionSettings implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="id") + @Column(name = "id") private int id; @Temporal(TemporalType.TIMESTAMP) - @Column(name="created_date", updatable=false) + @Column(name = "created_date", updatable = false) private Date createdDate; - @Column(name="description", nullable=true, length=2048) + @Column(name = "description", nullable = true, length = 2048) private String description; @Temporal(TemporalType.TIMESTAMP) - @Column(name="modified_date", nullable=false) + @Column(name = "modified_date", nullable = false) private Date modifiedDate; - @Column(name="PRIORITY", nullable=true) + @Column(name = "PRIORITY", nullable = true) @OrderBy("asc") private String priority; - @Column(name="xacml_id", unique = true, nullable=false) + @Column(name = "xacml_id", unique = true, nullable = false) @OrderBy("asc") private String xacmlId = "urn"; - //bi-directional many-to-one association to Datatype + // bi-directional many-to-one association to Datatype @ManyToOne - @JoinColumn(name="datatype") + @JoinColumn(name = "datatype") private Datatype datatypeBean; @Transient @@ -82,116 +90,230 @@ public class DecisionSettings implements Serializable { private boolean mustBePresent = false; @ManyToOne(optional = false) - @JoinColumn(name="created_by") + @JoinColumn(name = "created_by") private UserInfo userCreatedBy; @ManyToOne(optional = false) - @JoinColumn(name="modified_by") + @JoinColumn(name = "modified_by") private UserInfo userModifiedBy; + /** + * Gets the user created by. + * + * @return the user created by + */ public UserInfo getUserCreatedBy() { return userCreatedBy; } + /** + * Sets the user created by. + * + * @param userCreatedBy the new user created by + */ public void setUserCreatedBy(UserInfo userCreatedBy) { this.userCreatedBy = userCreatedBy; } + /** + * Gets the user modified by. + * + * @return the user modified by + */ public UserInfo getUserModifiedBy() { return userModifiedBy; } + /** + * Sets the user modified by. + * + * @param userModifiedBy the new user modified by + */ public void setUserModifiedBy(UserInfo userModifiedBy) { this.userModifiedBy = userModifiedBy; } + /** + * Pre persist. + */ @PrePersist - public void prePersist() { + public void prePersist() { Date date = new Date(); this.createdDate = date; this.modifiedDate = date; } + /** + * Pre update. + */ @PreUpdate public void preUpdate() { this.modifiedDate = new Date(); } + /** + * Gets the id. + * + * @return the id + */ public int getId() { return this.id; } + /** + * Sets the id. + * + * @param id the new id + */ public void setId(int id) { this.id = id; } - + /** + * Gets the created date. + * + * @return the created date + */ public Date getCreatedDate() { return this.createdDate; } + /** + * Sets the created date. + * + * @param createdDate the new created date + */ public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } + /** + * Gets the description. + * + * @return the description + */ public String getDescription() { return this.description; } + /** + * Sets the description. + * + * @param description the new description + */ public void setDescription(String description) { this.description = description; } + /** + * Gets the modified date. + * + * @return the modified date + */ public Date getModifiedDate() { return this.modifiedDate; } + /** + * Sets the modified date. + * + * @param modifiedDate the new modified date + */ public void setModifiedDate(Date modifiedDate) { this.modifiedDate = modifiedDate; } + /** + * Gets the xacml id. + * + * @return the xacml id + */ public String getXacmlId() { return this.xacmlId; } + /** + * Sets the xacml id. + * + * @param xacmlId the new xacml id + */ public void setXacmlId(String xacmlId) { this.xacmlId = xacmlId; } + /** + * Gets the datatype bean. + * + * @return the datatype bean + */ public Datatype getDatatypeBean() { return this.datatypeBean; } + /** + * Sets the datatype bean. + * + * @param datatypeBean the new datatype bean + */ public void setDatatypeBean(Datatype datatypeBean) { this.datatypeBean = datatypeBean; } + /** + * Gets the issuer. + * + * @return the issuer + */ @Transient public String getIssuer() { return issuer; } + /** + * Sets the issuer. + * + * @param issuer the new issuer + */ @Transient public void setIssuer(String issuer) { this.issuer = issuer; } + /** + * Checks if is must be present. + * + * @return true, if is must be present + */ @Transient public boolean isMustBePresent() { return mustBePresent; } + /** + * Sets the must be present. + * + * @param mustBePresent the new must be present + */ @Transient public void setMustBePresent(boolean mustBePresent) { this.mustBePresent = mustBePresent; } + /** + * Gets the priority. + * + * @return the priority + */ public String getPriority() { return priority; } + /** + * Sets the priority. + * + * @param priority the new priority + */ public void setPriority(String priority) { this.priority = priority; } } - diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DescriptiveScope.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DescriptiveScope.java index aab9126e2..d571ed719 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DescriptiveScope.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DescriptiveScope.java @@ -3,13 +3,14 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -38,10 +39,12 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; - +/** + * The Class DescriptiveScope. + */ @Entity @Table(name = "DescriptiveScope") -@NamedQuery(name = "DescriptiveScope.findAll", query= "Select p from DescriptiveScope p") +@NamedQuery(name = "DescriptiveScope.findAll", query = "Select p from DescriptiveScope p") public class DescriptiveScope implements Serializable { private static final long serialVersionUID = 1L; @Id @@ -49,104 +52,191 @@ public class DescriptiveScope implements Serializable { @Column(name = "Id") private int id; - @Column(name="scopename", nullable=false) + @Column(name = "scopename", nullable = false) @OrderBy("asc") private String descriptiveScopeName; - @Column(name="description", nullable=true, length=2048) + @Column(name = "description", nullable = true, length = 2048) private String description; - @Column(name="search", nullable=true) + @Column(name = "search", nullable = true) @OrderBy("asc") private String search; @Temporal(TemporalType.TIMESTAMP) - @Column(name="created_date", updatable=false) + @Column(name = "created_date", updatable = false) private Date createdDate; @Temporal(TemporalType.TIMESTAMP) - @Column(name="modified_date", nullable=false) + @Column(name = "modified_date", nullable = false) private Date modifiedDate; @ManyToOne(optional = false) - @JoinColumn(name="created_by") + @JoinColumn(name = "created_by") private UserInfo userCreatedBy; @ManyToOne(optional = false) - @JoinColumn(name="modified_by") + @JoinColumn(name = "modified_by") private UserInfo userModifiedBy; + /** + * Gets the user created by. + * + * @return the user created by + */ public UserInfo getUserCreatedBy() { return userCreatedBy; } + /** + * Sets the user created by. + * + * @param userCreatedBy the new user created by + */ public void setUserCreatedBy(UserInfo userCreatedBy) { this.userCreatedBy = userCreatedBy; } + /** + * Gets the user modified by. + * + * @return the user modified by + */ public UserInfo getUserModifiedBy() { return userModifiedBy; } + /** + * Sets the user modified by. + * + * @param userModifiedBy the new user modified by + */ public void setUserModifiedBy(UserInfo userModifiedBy) { this.userModifiedBy = userModifiedBy; } + /** + * Pre persist. + */ @PrePersist - public void prePersist() { + public void prePersist() { Date date = new Date(); this.createdDate = date; this.modifiedDate = date; } + /** + * Pre update. + */ @PreUpdate public void preUpdate() { this.modifiedDate = new Date(); } + /** + * Gets the id. + * + * @return the id + */ public int getId() { return this.id; } + + /** + * Sets the id. + * + * @param id the new id + */ public void setId(int id) { this.id = id; } + /** + * Gets the scope name. + * + * @return the scope name + */ public String getScopeName() { return descriptiveScopeName; } + /** + * Sets the scope name. + * + * @param descriptiveScopeName the new scope name + */ public void setScopeName(String descriptiveScopeName) { this.descriptiveScopeName = descriptiveScopeName; } + /** + * Gets the search. + * + * @return the search + */ public String getSearch() { return search; } + /** + * Sets the search. + * + * @param search the new search + */ public void setSearch(String search) { this.search = search; } + /** + * Gets the created date. + * + * @return the created date + */ public Date getCreatedDate() { return this.createdDate; } + /** + * Sets the created date. + * + * @param createdDate the new created date + */ public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } + /** + * Gets the description. + * + * @return the description + */ public String getDescription() { return this.description; } + /** + * Sets the description. + * + * @param description the new description + */ public void setDescription(String description) { this.description = description; } + /** + * Gets the modified date. + * + * @return the modified date + */ public Date getModifiedDate() { return this.modifiedDate; } + /** + * Sets the modified date. + * + * @param modifiedDate the new modified date + */ public void setModifiedDate(Date modifiedDate) { this.modifiedDate = modifiedDate; } diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DictionaryData.java b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DictionaryData.java index 85a5091e8..40b8fcc33 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DictionaryData.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DictionaryData.java @@ -3,6 +3,7 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,8 +33,6 @@ import javax.persistence.Table; @Table(name = "DictionaryData") @NamedQuery(name = "DictionaryData.findAll", query = "SELECT v FROM DictionaryData v ") public class DictionaryData { - private static final long serialVersionUID = 1L; - @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id") |