package com.xmomen.module.system.entity;

import com.xmomen.framework.mybatis.model.BaseMybatisModel;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

@Entity
@Table(name = "sys_dictionary")
public class SysDictionary extends BaseMybatisModel {
    /**
     * 
     */
    private Integer id;

    /**
     * 字典编号
     */
    private String dictionaryCode;

    /**
     * 字典描述
     */
    private String dictionaryDesc;

    /**
     * 是否启用
     */
    private Integer available;

    // 定义ID字段
    @Column(name = "ID")
    // 设置ID为主键
    @Id
    // 设置ID的生成方式为UUID
    @GeneratedValue(generator = "UUIDGenerator")
    public Integer getId() {
        // 返回ID
        return id;
    }

    // 设置ID
    public void setId(Integer id) {
        // 将传入的ID赋值给成员变量
        this.id = id;
        // 如果ID为空
        if(id == null){
              // 移除验证字段
              removeValidField("id");
              // 返回
              return;
        }
        addValidField("id");
    }
    // 获取字典代码

    @Column(name = "DICTIONARY_CODE")
    public String getDictionaryCode() {
        return dictionaryCode;
    }
    // 设置字典代码

    public void setDictionaryCode(String dictionaryCode) {
        // 如果字典代码为空，则移除有效字段
        this.dictionaryCode = dictionaryCode;
        if(dictionaryCode == null){
              removeValidField("dictionaryCode");
              return;
        }
        addValidField("dictionaryCode");
    }

    @Column(name = "DICTIONARY_DESC")
    // 获取字典描述
    public String getDictionaryDesc() {
        return dictionaryDesc;
    }

    // 设置字典描述
    public void setDictionaryDesc(String dictionaryDesc) {
        this.dictionaryDesc = dictionaryDesc;
        // 如果字典描述为空
        if(dictionaryDesc == null){
              // 移除有效字段
              removeValidField("dictionaryDesc");
              return;
        }
        addValidField("dictionaryDesc");
    }

    // 获取AVAILABLE字段的值
    @Column(name = "AVAILABLE")
    public Integer getAvailable() {
        return available;
    }

    // 设置AVAILABLE字段的值
    public void setAvailable(Integer available) {
        this.available = available;
        // 如果AVAILABLE字段的值为空
        if(available == null){
              // 移除验证字段
              removeValidField("available");
              return;
        }
        addValidField("available");
    }
}