2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
24 package org.onap.clamp.dao.model;
26 import com.google.gson.annotations.Expose;
28 import java.io.Serializable;
29 import java.time.Instant;
31 import javax.persistence.Column;
32 import javax.persistence.Entity;
33 import javax.persistence.EnumType;
34 import javax.persistence.Enumerated;
35 import javax.persistence.FetchType;
36 import javax.persistence.GeneratedValue;
37 import javax.persistence.GenerationType;
38 import javax.persistence.Id;
39 import javax.persistence.JoinColumn;
40 import javax.persistence.ManyToOne;
41 import javax.persistence.Table;
44 @Table(name = "loop_logs")
45 public class LoopLog implements Serializable {
49 private static final long serialVersionUID = 1988276670074437631L;
53 @GeneratedValue(strategy = GenerationType.AUTO)
57 @Column(name = "log_type", nullable = false)
58 @Enumerated(EnumType.STRING)
59 private LogType logType;
62 @Column(name = "message", nullable = false)
63 private String message;
65 @ManyToOne(fetch = FetchType.LAZY)
66 @JoinColumn(name = "loop_id", nullable = false)
70 @Column(name = "log_instant", nullable = false)
71 private Instant logInstant = Instant.now();
77 public void setId(long id) {
81 public LogType getLogType() {
85 public void setLogType(LogType logType) {
86 this.logType = logType;
89 public String getMessage() {
93 public void setMessage(String message) {
94 this.message = message;
97 public Loop getLoop() {
101 public void setLoop(Loop loop) {
105 public Instant getLogInstant() {
109 public void setLogInstant(Instant logInstant) {
110 this.logInstant = logInstant;