Enabling Code Formatter
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / commons / db-lib / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / db / primary / domain / BlueprintModelSearch.kt
1 /*
2  *  Copyright © 2019 IBM.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain
18
19 import com.fasterxml.jackson.annotation.JsonFormat
20 import com.fasterxml.jackson.annotation.JsonTypeInfo
21 import com.fasterxml.jackson.annotation.JsonTypeName
22 import org.springframework.data.annotation.LastModifiedDate
23 import java.io.Serializable
24 import java.util.Date
25 import javax.persistence.Column
26 import javax.persistence.Entity
27 import javax.persistence.Id
28 import javax.persistence.Lob
29 import javax.persistence.Table
30 import javax.persistence.Temporal
31 import javax.persistence.TemporalType
32
33 /**
34  * Provide Blueprint Model Search Entity
35  *
36  * @author Brinda Santh
37  * @version 1.0
38  */
39
40 @Entity
41 @Table(name = "BLUEPRINT_MODEL")
42 @JsonTypeName("blueprintModel")
43 @JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
44 class BlueprintModelSearch : Serializable {
45
46     @Id
47     @Column(name = "blueprint_model_id")
48     var id: String? = null
49
50     @Column(name = "artifact_uuid")
51     var artifactUUId: String? = null
52
53     @Column(name = "artifact_type")
54     var artifactType: String? = null
55
56     @Column(name = "artifact_version", nullable = false)
57     var artifactVersion: String? = null
58
59     @Lob
60     @Column(name = "artifact_description")
61     var artifactDescription: String? = null
62
63     @Column(name = "internal_version")
64     var internalVersion: Int? = null
65
66     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
67     @LastModifiedDate
68     @Temporal(TemporalType.TIMESTAMP)
69     @Column(name = "creation_date")
70     var createdDate = Date()
71
72     @Column(name = "artifact_name", nullable = false)
73     var artifactName: String? = null
74
75     @Column(name = "published", nullable = false)
76     var published: String? = null
77
78     @Column(name = "updated_by", nullable = false)
79     var updatedBy: String? = null
80
81     @Lob
82     @Column(name = "tags", nullable = false)
83     var tags: String? = null
84
85     companion object {
86
87         const val serialversionuid = 1L
88     }
89 }