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.apps.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 {
44 @Column(name = "config_model_id")
45 var id: String? = null
47 @Column(name = "artifact_uuid")
48 var artifactUUId: String? = null
50 @Column(name = "artifact_type")
51 var artifactType: String? = null
53 @Column(name = "artifact_version", nullable = false)
54 @ApiModelProperty(required = true)
55 var artifactVersion: String? = null
58 @Column(name = "artifact_description")
59 var artifactDescription: String? = null
61 @Column(name = "internal_version")
62 var internalVersion: Int? = null
64 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
66 @Temporal(TemporalType.TIMESTAMP)
67 @Column(name = "creation_date")
68 var createdDate = Date()
70 @Column(name = "artifact_name", nullable = false)
71 @ApiModelProperty(required = true)
72 var artifactName: String? = null
74 @Column(name = "published", nullable = false)
75 @ApiModelProperty(required = true)
76 var published: String? = null
78 @Column(name = "updated_by", nullable = false)
79 @ApiModelProperty(required = true)
80 var updatedBy: String? = null
83 @Column(name = "tags", nullable = false)
84 @ApiModelProperty(required = true)
85 var tags: String? = null
87 @OneToOne(mappedBy = "blueprintModel", fetch = FetchType.EAGER, orphanRemoval = true, cascade = [CascadeType.ALL])
88 var blueprintModelContent: BlueprintProcessorModelContent? = null
91 private const val serialVersionUID = 1L