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/22 上午10:58
 * @desc
 */

@Entity
@Table(name = "SCR_DATASOURCE")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@DynamicUpdate
@DynamicInsert
@Builder
@ApiModel("数据源管理")
public class ScrDatasource extends BaseBean implements Serializable {
    private static final long serialVersionUID = 2660387454249572573L;

    @Column(name = "SOURCE_NAME")
    @ApiModelProperty(value = "数据源名称")
    private String sourceName;

    @Column(name = "SOURCE_CODE")
    @ApiModelProperty(value = "数据源代码")
    private String sourceCode;

    @Column(name = "SOURCE_CONNECTION_STATUS")
    @ApiModelProperty(value = "数据源状态", name = "状态：可用，不可用 看枚举当中是否存在")
    private Integer sourceConnectionStatus;

    @Column(name = "SOURCE_TYPE")
    @ApiModelProperty(value = "数据源类型", name = "CommonEnumUtil.DATA_SOURCE_TYPE")
    private Integer sourceType;

    @Column(name = "SOURCE_HOST")
    @ApiModelProperty(value = "数据源连接地址")
    private String sourceHost;

    @Column(name = "SOURCE_PORT")
    @ApiModelProperty(value = "数据源端口")
    private Integer sourcePort;

    @Column(name = "SOURCE_DATA_BASE_NAME")
    @ApiModelProperty(value = "数据库名称")
    private String sourceDataBaseName;

    @Column(name = "SOURCE_USER_NAME")
    @ApiModelProperty(value = "数据库用户名称")
    private String sourceUserName;

    @Column(name = "SOURCE_PASSWORD")
    @ApiModelProperty(value = "数据库用户密码")
    private String sourcePassword;

    @Column(name = "IS_READ_ONLY")
    @ApiModelProperty(value = "是否只读")
    private Boolean isReadOnly;

    @Column(name = "SOURCE_DRIVER")
    @ApiModelProperty(value = "驱动")
    private String sourceDriver;

    @Column(name = "SOURCE_DRIVER_VERSION")
    @ApiModelProperty(value = "驱动版本")
    private String sourceDriverVersion;

    @Column(name = "SOURCE_VERSION")
    @ApiModelProperty(value = "数据库版本")
    private String sourceVersion;

    @Column(name = "SOURCE_DESCRIPTION")
    @ApiModelProperty(value = "数据源描述")
    private String sourceDescription;
}
