-
Notifications
You must be signed in to change notification settings - Fork 0
/
Chat.java
54 lines (41 loc) · 1.19 KB
/
Chat.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.example.account.models;
import java.io.Serializable;
import java.util.Date;
import com.example.account.util.entity.BaseEntity;
import jakarta.persistence.*;
import org.apache.catalina.User;
import org.hibernate.annotations.CreationTimestamp;
import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Chat extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "dateSent", nullable = false, updatable = false)
@CreationTimestamp
private Date dateSent;
@Column(length = 65555)
private String messageReceived;
@Column(length = 65555)
private String messageSent;
public Chat(String messageSent, String messageReceived) {
this.messageSent = messageSent;
this.messageReceived = messageReceived;
}
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
}