init
This commit is contained in:
52
src/main/java/kr/co/ragone/domain/DocChunk.java
Normal file
52
src/main/java/kr/co/ragone/domain/DocChunk.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package kr.co.ragone.domain;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.JdbcTypeCode;
|
||||
import org.hibernate.type.SqlTypes;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
@Entity
|
||||
@Table(name = "TB_DOC_CHUNK")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class DocChunk {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "chunk_id")
|
||||
private Long chunkId;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "doc_id")
|
||||
private DocInfo docInfo;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "topic_id")
|
||||
private TopicInfo topicInfo;
|
||||
|
||||
@Column(name = "chunk_content", nullable = false, columnDefinition = "TEXT")
|
||||
private String chunkContent;
|
||||
|
||||
// pgvector는 Native Query로 처리
|
||||
@Column(name = "chunk_embedding", columnDefinition = "vector(1536)")
|
||||
private String chunkEmbedding;
|
||||
|
||||
@Column(name = "chunk_index")
|
||||
private Integer chunkIndex;
|
||||
|
||||
@Column(name = "token_count")
|
||||
private Integer tokenCount;
|
||||
|
||||
@JdbcTypeCode(SqlTypes.JSON)
|
||||
@Column(name = "chunk_metadata", columnDefinition = "jsonb")
|
||||
private Map<String, Object> chunkMetadata;
|
||||
|
||||
@Column(name = "created_at")
|
||||
@Builder.Default
|
||||
private LocalDateTime createdAt = LocalDateTime.now();
|
||||
}
|
||||
Reference in New Issue
Block a user