/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.ctecinf.model;

import br.com.ctecinf.orm.Model;
import br.com.ctecinf.orm.Table;
import br.com.ctecinf.orm.Column;
import java.sql.Types;

/**
 *
 * @author Cássio Conceição
 * @since 13/09/2019 14:09:44
 * @version 201909
 * @see http://ctecinf.com.br/
 */
@Table("usuario")
public class Usuario extends Model {

    @Column(name = "nome", type = Types.VARCHAR, isNotNull = true, label = "Nome", tableDisplay = true)
    private String nome;

    @Column(name = "login", type = Types.VARCHAR, isNotNull = true, label = "Login")
    private String login;

    @Column(name = "senha", type = Types.VARCHAR, isNotNull = true, label = "Senha", isCrypt = true)
    private String senha;

    @Column(name = "readonly", type = Types.BOOLEAN, isNotNull = true, label = "Readonly")
    private Boolean readonly;

    public String getNome() {
        return this.nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getLogin() {
        return this.login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getSenha() {
        return this.senha;
    }

    public void setSenha(String senha) {
        this.senha = senha;
    }

    public Boolean getReadonly() {
        return this.readonly;
    }

    public void setReadonly(Boolean readonly) {
        this.readonly = readonly;
    }

    @Override
    public String toString() {
        return nome == null ? "Usuario {" + (getId() == null ? "Não cadastrado" : "ID = " + getId()) + "}" : nome;
    }
}
