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;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.GeneratedValue;
29 import javax.persistence.GenerationType;
30 import javax.persistence.Id;
31 import javax.persistence.Table;
32 import javax.persistence.Temporal;
33 import javax.persistence.TemporalType;
35 import org.apache.commons.lang3.builder.EqualsBuilder;
36 import org.apache.commons.lang3.builder.HashCodeBuilder;
37 import org.apache.commons.lang3.builder.ToStringBuilder;
39 import com.openpojo.business.annotation.BusinessKey;
42 @Table(name = "model_recipe")
43 public class ModelRecipe implements Serializable {
45 private static final long serialVersionUID = 768026109321305392L;
48 @Column(name = "ID", nullable = false, updatable = false)
49 @GeneratedValue(strategy = GenerationType.IDENTITY)
52 @Column(name = "MODEL_ID", nullable = false)
53 private Integer modelId;
55 @Column(name = "ACTION", length = 50)
56 private String action = null;
57 @Column(name = "SCHEMA_VERSION", length = 20)
58 private String schemaVersion = null;
59 @Column(name = "DESCRIPTION", length = 1200)
60 private String description = null;
61 @Column(name = "ORCHESTRATION_URI", length = 256)
62 private String orchestrationUri = null;
63 @Column(name = "MODEL_PARAM_XSD", length = 2048)
64 private String modelParamXSD = null;
65 @Column(name = "RECIPE_TIMEOUT")
66 private Integer recipeTimeout;
67 @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false)
68 @Temporal(TemporalType.TIMESTAMP)
69 private Date created = null;
74 public Integer getId() {
81 public Integer getModelId() {
86 * @param modelId the modelId to set
88 public void setModelId(Integer modelId) {
89 this.modelId = modelId;
95 public String getAction() {
100 * @param action the action to set
102 public void setAction(String action) {
103 this.action = action;
107 * @return the versionStr
109 public String getSchemaVersion() {
110 return schemaVersion;
114 * @param schemaVersion the versionStr to set
116 public void setSchemaVersion(String schemaVersion) {
117 this.schemaVersion = schemaVersion;
121 * @return the description
123 public String getDescription() {
128 * @param description the description to set
130 public void setDescription(String description) {
131 this.description = description;
135 * @return the orchestrationUri
137 public String getOrchestrationUri() {
138 return orchestrationUri;
142 * @param orchestrationUri the orchestrationUri to set
144 public void setOrchestrationUri(String orchestrationUri) {
145 this.orchestrationUri = orchestrationUri;
149 * @return the modelParamXSD
151 public String getModelParamXSD() {
152 return modelParamXSD;
156 * @param modelParamXSD the modelParamXSD to set
158 public void setModelParamXSD(String modelParamXSD) {
159 this.modelParamXSD = modelParamXSD;
163 * @return the recipeTimeout
165 public Integer getRecipeTimeout() {
166 return recipeTimeout;
170 * @param recipeTimeout the recipeTimeout to set
172 public void setRecipeTimeout(Integer recipeTimeout) {
173 this.recipeTimeout = recipeTimeout;
177 * @return the created
179 public Date getCreated() {
184 public boolean equals(final Object other) {
185 if (!(other instanceof ModelRecipe)) {
188 ModelRecipe castOther = (ModelRecipe) other;
189 return new EqualsBuilder().append(getModelId(), castOther.getModelId())
190 .append(getAction(), castOther.getAction()).isEquals();
194 public int hashCode() {
195 return new HashCodeBuilder().append(getModelId()).append(getAction()).toHashCode();
199 public String toString() {
200 return new ToStringBuilder(this).append("id", getId()).append("modelId", getModelId())
201 .append("action", getAction()).append("schemaVersion", getSchemaVersion())
202 .append("description", getDescription()).append("orchestrationUri", getOrchestrationUri())
203 .append("modelParamXSD", getModelParamXSD()).append("recipeTimeout", getRecipeTimeout())
204 .append("created", getCreated()).toString();