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;
37 import uk.co.blackpepper.bowman.annotation.RemoteResource;
40 @RemoteResource("/modelRecipe")
41 @Table(name = "model_recipe")
42 public class ModelRecipe implements Serializable {
44 private static final long serialVersionUID = 768026109321305392L;
47 @Column(name = "ID", nullable = false, updatable = false)
48 @GeneratedValue(strategy = GenerationType.IDENTITY)
51 @Column(name = "MODEL_ID", nullable = false)
52 private Integer modelId;
54 @Column(name = "ACTION", length = 50)
55 private String action = null;
56 @Column(name = "SCHEMA_VERSION", length = 20)
57 private String schemaVersion = null;
58 @Column(name = "DESCRIPTION", length = 1200)
59 private String description = null;
60 @Column(name = "ORCHESTRATION_URI", length = 256)
61 private String orchestrationUri = null;
62 @Column(name = "MODEL_PARAM_XSD", length = 2048)
63 private String modelParamXSD = null;
64 @Column(name = "RECIPE_TIMEOUT")
65 private Integer recipeTimeout;
66 @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false)
67 @Temporal(TemporalType.TIMESTAMP)
68 private Date created = null;
73 public Integer getId() {
80 public Integer getModelId() {
85 * @param modelId the modelId to set
87 public void setModelId(Integer modelId) {
88 this.modelId = modelId;
94 public String getAction() {
99 * @param action the action to set
101 public void setAction(String action) {
102 this.action = action;
106 * @return the versionStr
108 public String getSchemaVersion() {
109 return schemaVersion;
113 * @param schemaVersion the versionStr to set
115 public void setSchemaVersion(String schemaVersion) {
116 this.schemaVersion = schemaVersion;
120 * @return the description
122 public String getDescription() {
127 * @param description the description to set
129 public void setDescription(String description) {
130 this.description = description;
134 * @return the orchestrationUri
136 public String getOrchestrationUri() {
137 return orchestrationUri;
141 * @param orchestrationUri the orchestrationUri to set
143 public void setOrchestrationUri(String orchestrationUri) {
144 this.orchestrationUri = orchestrationUri;
148 * @return the modelParamXSD
150 public String getModelParamXSD() {
151 return modelParamXSD;
155 * @param modelParamXSD the modelParamXSD to set
157 public void setModelParamXSD(String modelParamXSD) {
158 this.modelParamXSD = modelParamXSD;
162 * @return the recipeTimeout
164 public Integer getRecipeTimeout() {
165 return recipeTimeout;
169 * @param recipeTimeout the recipeTimeout to set
171 public void setRecipeTimeout(Integer recipeTimeout) {
172 this.recipeTimeout = recipeTimeout;
176 * @return the created
178 public Date getCreated() {
183 public boolean equals(final Object other) {
184 if (!(other instanceof ModelRecipe)) {
187 ModelRecipe castOther = (ModelRecipe) other;
188 return new EqualsBuilder().append(getModelId(), castOther.getModelId())
189 .append(getAction(), castOther.getAction()).isEquals();
193 public int hashCode() {
194 return new HashCodeBuilder().append(getModelId()).append(getAction()).toHashCode();
198 public String toString() {
199 return new ToStringBuilder(this).append("id", getId()).append("modelId", getModelId())
200 .append("action", getAction()).append("schemaVersion", getSchemaVersion())
201 .append("description", getDescription()).append("orchestrationUri", getOrchestrationUri())
202 .append("modelParamXSD", getModelParamXSD()).append("recipeTimeout", getRecipeTimeout())
203 .append("created", getCreated()).toString();