64 lines
1.8 KiB
Java
64 lines
1.8 KiB
Java
package com.aiteacher.document;
|
|
|
|
import jakarta.persistence.*;
|
|
import java.time.Instant;
|
|
import java.util.UUID;
|
|
|
|
@Entity
|
|
@Table(name = "section")
|
|
public class SectionEntity {
|
|
|
|
@Id
|
|
@Column(name = "id", length = 200)
|
|
private String id;
|
|
|
|
@Column(name = "chapter_id", nullable = false, length = 200)
|
|
private String chapterId;
|
|
|
|
@Column(name = "book_id", nullable = false)
|
|
private UUID bookId;
|
|
|
|
@Column(name = "number", length = 50)
|
|
private String number;
|
|
|
|
@Column(name = "title", length = 500)
|
|
private String title;
|
|
|
|
@Column(name = "page_start", nullable = false)
|
|
private int pageStart;
|
|
|
|
@Column(name = "page_end", nullable = false)
|
|
private int pageEnd;
|
|
|
|
@Column(name = "full_text", nullable = false, columnDefinition = "TEXT")
|
|
private String fullText;
|
|
|
|
@Column(name = "created_at", nullable = false)
|
|
private Instant createdAt;
|
|
|
|
public SectionEntity() {}
|
|
|
|
public SectionEntity(String id, String chapterId, UUID bookId, String number,
|
|
String title, int pageStart, int pageEnd, String fullText) {
|
|
this.id = id;
|
|
this.chapterId = chapterId;
|
|
this.bookId = bookId;
|
|
this.number = number;
|
|
this.title = title;
|
|
this.pageStart = pageStart;
|
|
this.pageEnd = pageEnd;
|
|
this.fullText = fullText;
|
|
this.createdAt = Instant.now();
|
|
}
|
|
|
|
public String getId() { return id; }
|
|
public String getChapterId() { return chapterId; }
|
|
public UUID getBookId() { return bookId; }
|
|
public String getNumber() { return number; }
|
|
public String getTitle() { return title; }
|
|
public int getPageStart() { return pageStart; }
|
|
public int getPageEnd() { return pageEnd; }
|
|
public String getFullText() { return fullText; }
|
|
public Instant getCreatedAt() { return createdAt; }
|
|
}
|