2 * Copyright © 2017-2018 AT&T Intellectual Property.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.ccsdk.cds.controllerblueprints.service.domain;
19 import com.fasterxml.jackson.annotation.JsonFormat;
20 import com.fasterxml.jackson.databind.JsonNode;
21 import io.swagger.annotations.ApiModelProperty;
22 import org.springframework.data.annotation.LastModifiedDate;
23 import org.springframework.data.jpa.domain.support.AuditingEntityListener;
25 import javax.persistence.*;
26 import java.io.Serializable;
27 import java.util.Date;
31 * AsdcReference.java Purpose: Provide Configuration Generator AsdcReference Entity
33 * @author Brinda Santh
36 @EntityListeners({AuditingEntityListener.class})
38 @Table(name = "MODEL_TYPE")
39 public class ModelType implements Serializable {
40 private static final long serialVersionUID = 1L;
43 @Column(name = "model_name", nullable = false)
44 @ApiModelProperty(required=true)
45 private String modelName;
47 @Column(name = "derived_from", nullable = false)
48 @ApiModelProperty(required=true)
49 private String derivedFrom;
51 @Column(name = "definition_type", nullable = false)
52 @ApiModelProperty(required=true)
53 private String definitionType;
56 @Convert(converter = JpaJsonNodeConverter.class)
57 @Column(name = "definition", nullable = false)
58 @ApiModelProperty(required=true)
59 private JsonNode definition;
62 @Column(name = "description", nullable = false)
63 @ApiModelProperty(required=true)
64 private String description;
66 @Column(name = "version", nullable = false)
67 @ApiModelProperty(required=true)
68 private String version;
71 @Column(name = "tags", nullable = false)
72 @ApiModelProperty(required=true)
75 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
77 @Temporal(TemporalType.TIMESTAMP)
78 @Column(name = "creation_date")
79 private Date creationDate;
81 @Column(name = "updated_by", nullable = false)
82 @ApiModelProperty(required=true)
83 private String updatedBy;
86 public String toString() {
87 return "[" + "modelName = " + modelName +
88 ", derivedFrom = " + derivedFrom +
89 ", definitionType = " + definitionType +
90 ", description = " + description +
91 ", creationDate = " + creationDate +
92 ", version = " + version +
93 ", updatedBy = " + updatedBy +
98 public String getModelName() {
102 public void setModelName(String modelName) {
103 this.modelName = modelName;
106 public String getDerivedFrom() {
110 public void setDerivedFrom(String derivedFrom) {
111 this.derivedFrom = derivedFrom;
114 public String getDefinitionType() {
115 return definitionType;
118 public void setDefinitionType(String definitionType) {
119 this.definitionType = definitionType;
122 public JsonNode getDefinition() {
126 public void setDefinition(JsonNode definition) {
127 this.definition = definition;
130 public String getDescription() {
134 public void setDescription(String description) {
135 this.description = description;
138 public String getVersion() {
142 public void setVersion(String version) {
143 this.version = version;
146 public String getTags() {
150 public void setTags(String tags) {
154 public Date getCreationDate() {
158 public void setCreationDate(Date creationDate) {
159 this.creationDate = creationDate;
162 public String getUpdatedBy() {
166 public void setUpdatedBy(String updatedBy) {
167 this.updatedBy = updatedBy;