2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.onap.so.db.catalog.beans;
23 import java.io.Serializable;
24 import java.util.Date;
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.GeneratedValue;
28 import javax.persistence.GenerationType;
29 import javax.persistence.Id;
30 import javax.persistence.Table;
31 import javax.persistence.Temporal;
32 import javax.persistence.TemporalType;
33 import org.apache.commons.lang3.builder.EqualsBuilder;
34 import org.apache.commons.lang3.builder.HashCodeBuilder;
35 import org.apache.commons.lang3.builder.ToStringBuilder;
36 import com.openpojo.business.annotation.BusinessKey;
39 @Table(name = "model_recipe")
40 public class ModelRecipe implements Serializable {
42 private static final long serialVersionUID = 768026109321305392L;
45 @Column(name = "ID", nullable = false, updatable = false)
46 @GeneratedValue(strategy = GenerationType.IDENTITY)
49 @Column(name = "MODEL_ID", nullable = false)
50 private Integer modelId;
52 @Column(name = "ACTION", length = 50)
53 private String action = null;
54 @Column(name = "SCHEMA_VERSION", length = 20)
55 private String schemaVersion = null;
56 @Column(name = "DESCRIPTION", length = 1200)
57 private String description = null;
58 @Column(name = "ORCHESTRATION_URI", length = 256)
59 private String orchestrationUri = null;
60 @Column(name = "MODEL_PARAM_XSD", length = 2048)
61 private String modelParamXSD = null;
62 @Column(name = "RECIPE_TIMEOUT")
63 private Integer recipeTimeout;
64 @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false)
65 @Temporal(TemporalType.TIMESTAMP)
66 private Date created = null;
71 public Integer getId() {
78 public Integer getModelId() {
83 * @param modelId the modelId to set
85 public void setModelId(Integer modelId) {
86 this.modelId = modelId;
92 public String getAction() {
97 * @param action the action to set
99 public void setAction(String action) {
100 this.action = action;
104 * @return the versionStr
106 public String getSchemaVersion() {
107 return schemaVersion;
111 * @param schemaVersion the versionStr to set
113 public void setSchemaVersion(String schemaVersion) {
114 this.schemaVersion = schemaVersion;
118 * @return the description
120 public String getDescription() {
125 * @param description the description to set
127 public void setDescription(String description) {
128 this.description = description;
132 * @return the orchestrationUri
134 public String getOrchestrationUri() {
135 return orchestrationUri;
139 * @param orchestrationUri the orchestrationUri to set
141 public void setOrchestrationUri(String orchestrationUri) {
142 this.orchestrationUri = orchestrationUri;
146 * @return the modelParamXSD
148 public String getModelParamXSD() {
149 return modelParamXSD;
153 * @param modelParamXSD the modelParamXSD to set
155 public void setModelParamXSD(String modelParamXSD) {
156 this.modelParamXSD = modelParamXSD;
160 * @return the recipeTimeout
162 public Integer getRecipeTimeout() {
163 return recipeTimeout;
167 * @param recipeTimeout the recipeTimeout to set
169 public void setRecipeTimeout(Integer recipeTimeout) {
170 this.recipeTimeout = recipeTimeout;
174 * @return the created
176 public Date getCreated() {
181 public boolean equals(final Object other) {
182 if (!(other instanceof ModelRecipe)) {
185 ModelRecipe castOther = (ModelRecipe) other;
186 return new EqualsBuilder().append(getModelId(), castOther.getModelId())
187 .append(getAction(), castOther.getAction()).isEquals();
191 public int hashCode() {
192 return new HashCodeBuilder().append(getModelId()).append(getAction()).toHashCode();
196 public String toString() {
197 return new ToStringBuilder(this).append("id", getId()).append("modelId", getModelId())
198 .append("action", getAction()).append("schemaVersion", getSchemaVersion())
199 .append("description", getDescription()).append("orchestrationUri", getOrchestrationUri())
200 .append("modelParamXSD", getModelParamXSD()).append("recipeTimeout", getRecipeTimeout())
201 .append("created", getCreated()).toString();