2 * Copyright © 2019 IBM.
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.blueprintsprocessor.designer.api.domain
19 import com.fasterxml.jackson.annotation.JsonFormat
20 import io.swagger.annotations.ApiModelProperty
21 import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition
22 import org.springframework.data.annotation.LastModifiedDate
23 import org.springframework.data.jpa.domain.support.AuditingEntityListener
24 import java.io.Serializable
26 import javax.persistence.*
29 * Provide ResourceDictionary Entity
31 * @author Brinda Santh
34 @EntityListeners(AuditingEntityListener::class)
36 @Table(name = "RESOURCE_DICTIONARY")
37 class ResourceDictionary : Serializable {
40 @Column(name = "name", nullable = false)
41 @ApiModelProperty(required = true)
42 lateinit var name: String
44 @Column(name = "data_type", nullable = false)
45 @ApiModelProperty(required = true)
46 lateinit var dataType: String
48 @Column(name = "entry_schema")
49 var entrySchema: String? = null
52 @Convert(converter = JpaResourceDefinitionConverter::class)
53 @Column(name = "definition", nullable = false)
54 @ApiModelProperty(required = true)
55 lateinit var definition: ResourceDefinition
58 @Column(name = "description", nullable = false)
59 @ApiModelProperty(required = true)
60 lateinit var description: String
63 @Column(name = "tags", nullable = false)
64 @ApiModelProperty(required = true)
65 lateinit var tags: String
67 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
69 @Temporal(TemporalType.TIMESTAMP)
70 @Column(name = "creation_date")
71 var creationDate: Date? = null
73 @Column(name = "updated_by", nullable = false)
74 @ApiModelProperty(required = true)
75 lateinit var updatedBy: String
77 override fun toString(): String {
78 return "[" + ", name = " + name +
79 ", dataType = " + dataType +
80 ", entrySchema = " + entrySchema +
81 ", definition =" + definition +
82 ", description = " + description +
83 ", updatedBy = " + updatedBy +
85 ", creationDate = " + creationDate +
90 private const val serialVersionUID = 1L