2 * Copyright © 2018-2019 AT&T Intellectual Property.
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.functions.message.prioritization.db
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 org.springframework.data.jpa.repository.config.EnableJpaAuditing
25 import javax.persistence.*
28 @EntityListeners(AuditingEntityListener::class)
30 @Table(name = "MESSAGE_PRIORITIZATION")
32 open class MessagePrioritization {
34 @Column(name = "message_id", length = 50)
35 lateinit var id: String
37 @Column(name = "message_group", length = 50, nullable = false)
38 lateinit var group: String
40 @Column(name = "message_type", length = 50, nullable = false)
41 lateinit var type: String
43 /** States Defined by MessageState */
44 @Column(name = "message_state", length = 20, nullable = false)
45 lateinit var state: String
48 @Column(name = "message", nullable = false)
49 var message: String? = null
52 @Column(name = "error", nullable = true)
53 var error: String? = null
56 @Column(name = "aggregated_message_ids", nullable = true)
57 var aggregatedMessageIds: String? = null
60 @Column(name = "correlation_id", nullable = true)
61 var correlationId: String? = null
63 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
64 @Temporal(TemporalType.TIMESTAMP)
65 @Column(name = "created_date", nullable = false)
66 var createdDate = Date()
68 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
70 @Temporal(TemporalType.TIMESTAMP)
71 @Column(name = "updated_date", nullable = false)
72 var updatedDate: Date? = null
74 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
75 @Temporal(TemporalType.TIMESTAMP)
76 @Column(name = "expiry_date", nullable = false)
77 var expiryDate: Date? = null