Files
no-copy/src/main/java/ru/soune/nocopy/entity/violation/ViolationNotion.java
T

48 lines
1.3 KiB
Java
Raw Normal View History

2026-03-17 16:35:27 +07:00
package ru.soune.nocopy.entity.violation;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import ru.soune.nocopy.entity.file.FileEntity;
import ru.soune.nocopy.entity.user.User;
import java.time.LocalDateTime;
@Entity
@Getter @Setter
@Table(name = "violation_notions")
@NoArgsConstructor
@EntityListeners(AuditingEntityListener.class)
public class ViolationNotion {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
@JsonIgnore
private User user;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "file_id", nullable = false)
@JsonIgnore
private FileEntity file;
@CreatedDate
@Column(name = "created_at", updatable = false, nullable = false)
private LocalDateTime createdAt;
@LastModifiedDate
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
@Column(name = "message")
private String message;
}