You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
44 lines
1.1 KiB
package com.mydreamjob.messaging;
|
|
|
|
import jakarta.persistence.*;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.Builder;
|
|
import lombok.Data;
|
|
import lombok.NoArgsConstructor;
|
|
import org.springframework.data.annotation.CreatedDate;
|
|
import org.springframework.data.annotation.LastModifiedDate;
|
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
@Data
|
|
@Builder
|
|
@NoArgsConstructor
|
|
@AllArgsConstructor
|
|
@Entity
|
|
@Table(name = "conversations")
|
|
@EntityListeners(AuditingEntityListener.class)
|
|
public class Conversation {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
@Column(length = 200)
|
|
private String title;
|
|
|
|
@Column(nullable = false, length = 20)
|
|
@Builder.Default
|
|
private String type = "DIRECT";
|
|
|
|
@Column(name = "created_by", nullable = false)
|
|
private Long createdBy;
|
|
|
|
@CreatedDate
|
|
@Column(name = "created_at", nullable = false, updatable = false)
|
|
private LocalDateTime createdAt;
|
|
|
|
@LastModifiedDate
|
|
@Column(name = "updated_at", nullable = false)
|
|
private LocalDateTime updatedAt;
|
|
}
|
|
|