Migrate ccsdk/apps to ccsdk/cds
[ccsdk/cds.git] / ms / blueprintsprocessor / functions / resource-resolution / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / functions / resource / resolution / db / ResourceResolutionResult.kt
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 org.hibernate.annotations.Proxy
21 import org.springframework.data.annotation.LastModifiedDate
22 import org.springframework.data.jpa.domain.support.AuditingEntityListener
23 import java.io.Serializable
24 import java.util.*
25 import javax.persistence.Column
26 import javax.persistence.Entity
27 import javax.persistence.EntityListeners
28 import javax.persistence.Id
29 import javax.persistence.Lob
30 import javax.persistence.Table
31 import javax.persistence.Temporal
32 import javax.persistence.TemporalType
33
34 @EntityListeners(AuditingEntityListener::class)
35 @Entity
36 @Table(name = "RESOURCE_RESOLUTION_RESULT")
37 @Proxy(lazy = false)
38 class ResourceResolutionResult : Serializable {
39
40     @Id
41     @Column(name = "resource_resolution_result_id")
42     var id: String? = null
43
44     @Column(name = "resolution_key", nullable = false)
45     var resolutionKey: String? = null
46
47     @Column(name = "blueprint_name", nullable = false)
48     var blueprintName: String? = null
49
50     @Column(name = "blueprint_version", nullable = false)
51     var blueprintVersion: String? = null
52
53     @Column(name = "artifact_name", nullable = false)
54     var artifactName: String? = null
55
56     @Lob
57     @Column(name = "result", nullable = false)
58     var result: String? = 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     companion object {
67         private const val serialVersionUID = 1L
68     }
69 }