package com.tykj.workflowcore.model_layer.entity;


import com.tykj.workflowcore.base.entity.BaseEntity;
import com.tykj.workflowcore.model_layer.annotations.WorkFlowCoreNoScan;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.*;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @ClassName TableInfo
 * @Description TODO
 * @Author WWW
 * @Date 2021/2/24 11:05
 * @Version 1.0
 */
@WorkFlowCoreNoScan
@Entity
//@Table(name = "workflow_table_info")
@EntityListeners(AuditingEntityListener.class)
@Data
@SQLDelete(sql = "update table_info set deleted = 1 where id = ?")
@Where(clause = "deleted = 0")
public class TableInfo extends BaseEntity  {


    @ApiModelProperty("表名，不能为空")
    @Column(nullable = false)
    private String modelName;
    @ApiModelProperty("表中文名，不能为空")
    @Column(nullable = false)
    private String modelTitle;

    @ApiModelProperty("详细描述")
    private String description;

    /**
     *0是扫描，1是自建，2基础对象转变的业务对象
     */
    @ApiModelProperty("建表类型")
    private Integer modelType;

    @ApiModelProperty("执行人（保留字段）")
    private String reviser;
    @ApiModelProperty("父表名称")
    private String parentTable;

    /**
     * 聚合对象主表id
     */
    @ApiModelProperty("主表id")
    private Integer mainTableId;

    @Lob
    @ApiModelProperty("表对应hbm.xml")
    private String xml;



}
