2 * Copyright © 2019 IBM.
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 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
26 import javax.persistence.*
29 * Provide Configuration Generator BlueprintModel Entity
31 * @author Brinda Santh
35 @EntityListeners(AuditingEntityListener::class)
37 @Table(name = "CONFIG_MODEL", uniqueConstraints = [UniqueConstraint(columnNames = ["artifact_name", "artifact_version"])])
39 class BlueprintModel : Serializable {
41 @Column(name = "config_model_id")
42 var id: String? = null
44 @Column(name = "service_uuid")
45 var serviceUUID: String? = null
47 @Column(name = "distribution_id")
48 var distributionId: String? = null
50 @Column(name = "service_name")
51 var serviceName: String? = null
53 @Column(name = "service_description")
54 var serviceDescription: String? = null
56 @Column(name = "resource_uuid")
57 var resourceUUID: String? = null
59 @Column(name = "resource_instance_name")
60 var resourceInstanceName: String? = null
62 @Column(name = "resource_name")
63 var resourceName: String? = null
65 @Column(name = "resource_version")
66 var resourceVersion: String? = null
68 @Column(name = "resource_type")
69 var resourceType: String? = null
71 @Column(name = "artifact_uuid")
72 var artifactUUId: String? = null
74 @Column(name = "artifact_type")
75 var artifactType: String? = null
77 @Column(name = "artifact_version", nullable = false)
78 @ApiModelProperty(required = true)
79 var artifactVersion: String? = null
82 @Column(name = "artifact_description")
83 var artifactDescription: String? = null
85 @Column(name = "internal_version")
86 var internalVersion: Int? = null
88 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
90 @Temporal(TemporalType.TIMESTAMP)
91 @Column(name = "creation_date")
92 var createdDate = Date()
94 @Column(name = "artifact_name", nullable = false)
95 @ApiModelProperty(required = true)
96 var artifactName: String? = null
98 @Column(name = "published", nullable = false)
99 @ApiModelProperty(required = true)
100 var published: String? = null
102 @Column(name = "updated_by", nullable = false)
103 @ApiModelProperty(required = true)
104 var updatedBy: String? = null
107 @Column(name = "tags", nullable = false)
108 @ApiModelProperty(required = true)
109 var tags: String? = null
111 @OneToOne(mappedBy = "blueprintModel", fetch = FetchType.EAGER, orphanRemoval = true, cascade = [CascadeType.ALL])
112 var blueprintModelContent: BlueprintModelContent? = null
115 private const val serialVersionUID = 1L