package cn.estsh.i3plus.pojo.screen.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

/**
 * @author Wynne.Lu
 * @date 2021/3/12 下午4:26
 * @desc
 */
@Entity
@Table(name = "SCR_MODEL_FIELD_INDEX")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@DynamicUpdate
@DynamicInsert
@Builder
@ApiModel("model字段约束")
public class ScrModelFieldIndex extends BaseBean implements Serializable {
    private static final long serialVersionUID = 5020158684534641672L;

    @Column(name = "MODEL_CODE")
    @ApiModelProperty("model代码")
    private String modelCode;

    @Column(name = "INDEX_TYPE")
    @ApiModelProperty("约束类型")
    private Integer indexType;

    @Column(name = "GROUP_NO")
    @ApiModelProperty("组号")
    private Integer groupNo;

    @Column(name = "FIELD_CODE")
    @ApiModelProperty("字段代码")
    private String fieldCode;

    @Column(name = "IS_USER_CREATED")
    @ApiModelProperty("是否是用户创建的")
    private Integer isUserCreated;

    @Column(name = "PRIMARY_KEY_SWITCH")
    @ApiModelProperty("model主键唯一检查开关")
    private Integer primaryKeySwitch;

    @Column(name = "UNIQUE_KEY_SWITCH")
    @ApiModelProperty("model唯一键唯一检查开关")
    private Integer uniqueKeySwitch;
}
