diff --git a/src/com/rjconsultores/ventaboletos/entidad/EsquemaCorrida.java b/src/com/rjconsultores/ventaboletos/entidad/EsquemaCorrida.java index 94f55309f..ff7ab5fa3 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/EsquemaCorrida.java +++ b/src/com/rjconsultores/ventaboletos/entidad/EsquemaCorrida.java @@ -121,15 +121,34 @@ public class EsquemaCorrida implements Serializable { - private static List tpGeneraFeriadoList = new ArrayList(); + public enum gerarFeriado { + // Declaração dos enum + GERARSEMPRE ("GERAR SEMPRE", "S"), - static{ - - tpGeneraFeriadoList.add("GERAR SEMPRE"); - tpGeneraFeriadoList.add("GERAR SO QUANDO FOR FERIADO"); - tpGeneraFeriadoList.add("GERAR QUANDO NAO FOR FERIADO"); + GERARQUANDOFERIADO ("GERAR SÓ QUANDO FOR FERIADO", "F"), + + GERARQUANDONAOFERIADO ("GERAR QUANDO NÃO FOR FERIADO", "N"); + + // Definição das constantes + public final String valor; + public final String descricao; + + + public String valor() { + return this.valor; + } + public String descricao() { + return this.descricao; + } + private gerarFeriado( String descricao, String valor) { + this.descricao = descricao; + this.valor = valor; + } + + } + public String getTipocorrida() { return tipocorrida; } @@ -420,13 +439,7 @@ public class EsquemaCorrida implements Serializable { - public static List getTpGeneraFeriadoList() { - return tpGeneraFeriadoList; - } - - public static void setTpGeneraFeriadoList(List tpGeneraFeriadoList) { - EsquemaCorrida.tpGeneraFeriadoList = tpGeneraFeriadoList; - } + @Override public int hashCode() { diff --git a/src/com/rjconsultores/ventaboletos/entidad/PtovtaAgencia.java b/src/com/rjconsultores/ventaboletos/entidad/PtovtaAgencia.java index 0c341bf27..8c3b5c43c 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/PtovtaAgencia.java +++ b/src/com/rjconsultores/ventaboletos/entidad/PtovtaAgencia.java @@ -88,15 +88,60 @@ public class PtovtaAgencia implements Serializable { this.ptovtaAgenciaId = ptovtaAgenciaId; } - private static List pessoaList = new ArrayList(); - private static List tpContaList = new ArrayList(); - - static{ - pessoaList.add("FÍSICA"); - pessoaList.add("JURÍDICA"); - - tpContaList.add("RECEITA LÍQUIDA"); - tpContaList.add("RECEITA BRUTA"); + + + public enum enumTipoConta { + // Declaração dos enum + RECEITALIQUIDA ("RECEITA LÍQUIDA", "RL"), + + RECEITABRUTA ("RECEITA BRUTA", "RB"); + + + + // Definição das constantes + public final String valor; + public final String descricao; + + + public String valor() { + return this.valor; + } + public String descricao() { + return this.descricao; + } + private enumTipoConta( String descricao, String valor) { + this.descricao = descricao; + this.valor = valor; + } + + + } + + public enum enumTipoPessoa { + // Declaração dos enum + PESSOAFISICA ("PESSOA FÍSICA", "F"), + + PESSOAJURIDICA ("PESSOA JURÍDICA", "J"); + + + + // Definição das constantes + public final String valor; + public final String descricao; + + + public String valor() { + return this.valor; + } + public String descricao() { + return this.descricao; + } + private enumTipoPessoa( String descricao, String valor) { + this.descricao = descricao; + this.valor = valor; + } + + } public PtovtaAgencia(Integer ptovtaAgenciaId, String numagencia, String digito, String numconta, String pessoa, String tipo, String bilhetes, String carga, Boolean activo, Date fecmodif, int usuarioId) { @@ -222,13 +267,13 @@ public class PtovtaAgencia implements Serializable { } - public static List getPessoaList() { - return pessoaList; - } - - public static List getTipoContaList() { - return tpContaList; - } +// public static List getPessoaList() { +// return pessoaList; +// } +// +// public static List getTipoContaList() { +// return tpContaList; +// } @Override public int hashCode() { diff --git a/src/com/rjconsultores/ventaboletos/entidad/PtovtaDiversos.java b/src/com/rjconsultores/ventaboletos/entidad/PtovtaDiversos.java index f1cee0269..0c4a280cf 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/PtovtaDiversos.java +++ b/src/com/rjconsultores/ventaboletos/entidad/PtovtaDiversos.java @@ -94,15 +94,43 @@ public class PtovtaDiversos implements Serializable { public PtovtaDiversos() { } - - private static List posicaoList = new ArrayList(); - static{ - posicaoList.add("FORA DO EIXO DA LINHA"); - posicaoList.add("NO EIXO DA LINHA"); + public enum gerarEnum { + // Declaração dos enum - } + POSICAOFORAEIXO ("FORA DO EIXO DA LINHA", "FEL"), + POSICAONOEIXO ("NO EIXO DA LINHA", "EL"); + + + + // Definição das constantes + public final String valor; + public final String descricao; + + + public String valor() { + return this.valor; + } + public String descricao() { + return this.descricao; + } + private gerarEnum( String descricao, String valor) { + this.descricao = descricao; + this.valor = valor; + } + + + } + +// private static List posicaoList = new ArrayList(); +// +// static{ +// posicaoList.add("FORA DO EIXO DA LINHA"); +// posicaoList.add("NO EIXO DA LINHA"); +// +// } +// public PtovtaDiversos(Integer ptovtaDiversosId, String responAluguel, String responTelefone, String responEnergia, String posicao, Boolean informatizada, Boolean bilheteInfo, Boolean vendaInternet, Boolean digitacaoSeq, Boolean teleEntrega, Boolean trabalhaBilhete, Boolean ofpsPropria, Boolean ofpsTerceiros, Boolean activo, Date fecmodif, int usuarioId) { super(); @@ -265,15 +293,8 @@ public class PtovtaDiversos implements Serializable { } - public static List getPosicaoList() { - return posicaoList; - } - public static void setPosicaoList(List posicaoList) { - PtovtaDiversos.posicaoList = posicaoList; - } - @Override public int hashCode() { diff --git a/src/com/rjconsultores/ventaboletos/entidad/PtovtaEstoque.java b/src/com/rjconsultores/ventaboletos/entidad/PtovtaEstoque.java index 803d22a8c..cad5b11ad 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/PtovtaEstoque.java +++ b/src/com/rjconsultores/ventaboletos/entidad/PtovtaEstoque.java @@ -45,13 +45,13 @@ public class PtovtaEstoque implements Serializable { private String especie; @Column(name = "FORMCONT") - private String formCont; + private Integer formCont; @Column(name = "QUANTIDADE") private int quantidade; @Column(name = "LOTEFORM") - private String loteform; + private Integer loteform; @Basic(optional = false) @Column(name = "ACTIVO") @@ -74,19 +74,37 @@ public class PtovtaEstoque implements Serializable { this.ptovtaEstoqueId = ptovtaEstoqueId; } - - private static List formList = new ArrayList(); - private static List loteList = new ArrayList(); - static{ - formList.add("SIM"); - formList.add("NÃO"); - - loteList.add("SIM"); - loteList.add("NÃO"); + + + public enum gerarEnum { + // Declaração dos enum + SIM ("SIM", "1"), + + NAO ("NAO", "0"); + + + + // Definição das constantes + public final String valor; + public final String descricao; + + + public String valor() { + return this.valor; + } + public String descricao() { + return this.descricao; + } + private gerarEnum( String descricao, String valor) { + this.descricao = descricao; + this.valor = valor; + } + + } - public PtovtaEstoque(Integer ptovtaEstoqueId, String especie, String formCont, int quantidade, String loteform, Boolean activo, Date fecmodif, int usuarioId) { + public PtovtaEstoque(Integer ptovtaEstoqueId, String especie, Integer formCont, int quantidade, Integer loteform, Boolean activo, Date fecmodif, int usuarioId) { this.ptovtaEstoqueId = ptovtaEstoqueId; this.especie = especie; this.formCont = formCont; @@ -115,11 +133,11 @@ public class PtovtaEstoque implements Serializable { this.especie = especie; } - public String getFormCont() { + public Integer getFormCont() { return formCont; } - public void setFormCont(String formCont) { + public void setFormCont(Integer formCont) { this.formCont = formCont; } @@ -131,11 +149,11 @@ public class PtovtaEstoque implements Serializable { this.quantidade = quantidade; } - public String getLoteform() { + public Integer getLoteform() { return loteform; } - public void setLoteform(String loteform) { + public void setLoteform(Integer loteform) { this.loteform = loteform; } @@ -171,23 +189,6 @@ public class PtovtaEstoque implements Serializable { this.puntoventaId = puntoventaId; } - - - public static List getFormList() { - return formList; - } - - public static void setFormList(List formList) { - PtovtaEstoque.formList = formList; - } - - public static List getLoteList() { - return loteList; - } - - public static void setLoteList(List loteList) { - PtovtaEstoque.loteList = loteList; - } @Override public int hashCode() {