767a1feaf83b21d7426d72ce94e4281510984bd6
[ccsdk/cds.git] /
1 /*
2  * Copyright © 2019 Bell Canada
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.functions.resource.resolution.db
18
19 import com.fasterxml.jackson.annotation.JsonFormat
20 import com.fasterxml.jackson.annotation.JsonProperty
21 import org.hibernate.annotations.Proxy
22 import org.springframework.data.annotation.LastModifiedDate
23 import org.springframework.data.jpa.domain.support.AuditingEntityListener
24 import java.io.Serializable
25 import java.util.*
26 import javax.persistence.Column
27 import javax.persistence.Entity
28 import javax.persistence.EntityListeners
29 import javax.persistence.Id
30 import javax.persistence.Lob
31 import javax.persistence.Table
32 import javax.persistence.Temporal
33 import javax.persistence.TemporalType
34
35 @EntityListeners(AuditingEntityListener::class)
36 @Entity
37 @Table(name = "RESOURCE_RESOLUTION")
38 @Proxy(lazy = false)
39 class ResourceResolution : Serializable {
40
41     @Id
42     @Column(name = "resource_resolution_id")
43     var id: String? = null
44
45     @Column(name = "resolution_key", nullable = false)
46     var resolutionKey: String? = null
47
48     @Column(name = "resource_type", nullable = false)
49     var resourceType: String? = null
50
51     @Column(name = "resource_id", nullable = false)
52     var resourceId: String? = null
53
54     @Column(name = "blueprint_name", nullable = false)
55     var blueprintName: String? = null
56
57     @Column(name = "blueprint_version", nullable = false)
58     var blueprintVersion: String? = null
59
60     @Column(name = "artifact_name", nullable = false)
61     var artifactName: String? = null
62
63     @Column(name = "status", nullable = false)
64     var status: String? = null
65
66     @Column(name = "name", nullable = false)
67     var name: String? = null
68
69     @Column(name = "dictionary_vname", nullable = false)
70     var dictionaryName: String? = null
71
72     @Column(name = "dictionary_status", nullable = false)
73     var dictionarySource: String? = null
74
75     @Column(name = "dictionary_version", nullable = false)
76     var dictionaryVersion: Int = 0
77
78     @Lob
79     @Column(name = "value", nullable = false)
80     var value: String? = null
81
82     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
83     @LastModifiedDate
84     @Temporal(TemporalType.TIMESTAMP)
85     @Column(name = "creation_date")
86     var createdDate = Date()
87
88     companion object {
89         private const val serialVersionUID = 1L
90     }
91 }