2 * Copyright © 2019 Bell Canada
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.db.primary.domain
19 import com.fasterxml.jackson.annotation.JsonFormat
20 import io.swagger.annotations.ApiModelProperty
21 import javax.persistence.Entity
22 import javax.persistence.EntityListeners
23 import javax.persistence.Table
24 import org.hibernate.annotations.Proxy
25 import org.springframework.data.annotation.LastModifiedDate
26 import org.springframework.data.jpa.domain.support.AuditingEntityListener
27 import java.io.Serializable
29 import javax.persistence.CascadeType
30 import javax.persistence.Column
31 import javax.persistence.FetchType
32 import javax.persistence.Id
33 import javax.persistence.Lob
34 import javax.persistence.OneToOne
35 import javax.persistence.Temporal
36 import javax.persistence.TemporalType
38 @EntityListeners(AuditingEntityListener::class)
40 @Table(name = "BLUEPRINT_RUNTIME")
42 class BlueprintProcessorModel : Serializable {
45 @Column(name = "blueprint_runtime_id")
46 var id: String? = null
48 @Column(name = "artifact_type")
49 var artifactType: String? = null
51 @Column(name = "artifact_version", nullable = false)
52 @ApiModelProperty(required = true)
53 var artifactVersion: String? = null
56 @Column(name = "artifact_description")
57 var artifactDescription: String? = null
59 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
61 @Temporal(TemporalType.TIMESTAMP)
62 @Column(name = "creation_date")
63 var createdDate = Date()
65 @Column(name = "artifact_name", nullable = false)
66 @ApiModelProperty(required = true)
67 var artifactName: String? = null
69 @Column(name = "updated_by", nullable = false)
70 @ApiModelProperty(required = true)
71 var updatedBy: String? = null
74 @Column(name = "tags", nullable = false)
75 @ApiModelProperty(required = true)
76 var tags: String? = null
78 @OneToOne(mappedBy = "blueprintModel", fetch = FetchType.EAGER, orphanRemoval = true, cascade = [CascadeType.ALL])
79 var blueprintModelContent: BlueprintProcessorModelContent? = null
82 private const val serialVersionUID = 1L