package com.icomsys.main_vm.db.jpa.entity.scenario;


import com.icomsys.main_vm.db.jpa.entity.scenario.id.TbLongtextManagerId;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

@Table(name = "TB_LONGTEXT_MANAGER")
@Entity
@Getter
@Setter
@NoArgsConstructor
@DynamicUpdate
@IdClass(TbLongtextManagerId.class)
public class TbLongtextManager {

    @Id
    @Column(name = "RF_SEQ", nullable = false)
    private Long rfSeq;
    @Id
    @Column(name = "TABLE_CODE", nullable = false)
    private int tableCode;
    @Id
    @Column(name = "COLUMN_CODE", nullable = false)
    private int columnCode;
    @Column(name = "TEXT_CONTENTS", nullable = false, columnDefinition = "MEDIUMTEXT")
    private String textContents;
    @Column(name = "CHECKSUM", nullable = true, length = 32)
    private String checksum;

    @Builder
    public TbLongtextManager(Long rfSeq, int tableCode, int columnCode, String textContents, String checksum) {
        this.rfSeq = rfSeq;
        this.tableCode = tableCode;
        this.columnCode = columnCode;
        this.textContents = textContents;
        this.checksum = checksum;
    }

}
