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

import cn.estsh.i3plus.pojo.aps.common.BaseCode;
import cn.estsh.i3plus.pojo.aps.enums.FIELD_TYPE;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.lang.reflect.Method;
import java.sql.JDBCType;

/**
 * @Description :字段信息
 * @Reference :
 * @Author : jason.niu
 * @CreateDate : 2019-09-11
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="APS_FIELD_INFO")
@Api("字段信息")
public class FieldInfo extends BaseCode {
    @Column(name="CLASS_NAME")
    @ApiParam(value ="所属类简称")
    private String className;

    @Column(name="TYPE")
    @ApiParam(value ="类型")
    private FIELD_TYPE type;

    @Column(name="TYPE_NAME")
    @ApiParam(value ="类型全称")
    private String typeName;

    @Column(name="CUSTOMIZE")
    @ApiParam(value ="是否为自定义字段")
    private Boolean customize;

    @Column(name="MODIFY")
    @ApiParam(value ="是否能修改")
    private Boolean modify;

    @Column(name="DISPLAY")
    @ApiParam(value ="是否在界面显示")
    private Boolean display;

    @Column(name="PRIC")
    @ApiParam(value ="浮点数显示精度")
    private Integer pric;

    @Column(name="TIPS")
    @ApiParam(value ="字段提示")
    private String tips;

    @Column(name="EXPRESSION")
    @ApiParam(value ="表达式")
    private String expression;

    @Column(name="POSITION")
    @ApiParam(value ="位置")
    private String position;

    @Column(name="MAIN_KEY")
    @ApiParam(value ="主键标识")
    private Boolean mainKey;

    @Column(name="JDBC_TYPE")
    @ApiParam(value ="数据库类型")
    private JDBCType jdbcType;

    @JsonIgnore
    private transient Class<? extends BaseBean> clazz;
    @JsonIgnore
    private transient Class<?> typeClass;
    @JsonIgnore
    private transient Method getMethod;
    @JsonIgnore
    private transient Method setMethod;
}
