f00d5cadfaa02300ed053f95b5a150e987b36ec3
[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.*
25 import javax.persistence.*
26
27 /**
28  * Provide Blueprint Model Search Entity
29  *
30  * @author Brinda Santh
31  * @version 1.0
32  */
33
34 @Entity
35 @Table(name = "CONFIG_MODEL")
36 @JsonTypeName("blueprintModel")
37 @JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
38 class BlueprintModelSearch : Serializable {
39
40     @Id
41     @Column(name = "config_model_id")
42     var id: String? = null
43
44     @Column(name = "artifact_uuid")
45     var artifactUUId: String? = null
46
47     @Column(name = "artifact_type")
48     var artifactType: String? = null
49
50     @Column(name = "artifact_version", nullable = false)
51     var artifactVersion: String? = null
52
53     @Lob
54     @Column(name = "artifact_description")
55     var artifactDescription: String? = null
56
57     @Column(name = "internal_version")
58     var internalVersion: Int? = null
59
60     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
61     @LastModifiedDate
62     @Temporal(TemporalType.TIMESTAMP)
63     @Column(name = "creation_date")
64     var createdDate = Date()
65
66     @Column(name = "artifact_name", nullable = false)
67     var artifactName: String? = null
68
69     @Column(name = "published", nullable = false)
70     var published: String? = null
71
72     @Column(name = "updated_by", nullable = false)
73     var updatedBy: String? = null
74
75     @Lob
76     @Column(name = "tags", nullable = false)
77     var tags: String? = null
78
79     companion object {
80         const val serialversionuid = 1L
81     }
82 }