1 package ecar.pojo;
2
3
4
5 import java.util.HashSet;
6 import java.util.Set;
7 import javax.persistence.CascadeType;
8 import javax.persistence.Column;
9 import javax.persistence.Entity;
10 import javax.persistence.FetchType;
11 import javax.persistence.GeneratedValue;
12 import javax.persistence.Id;
13 import javax.persistence.OneToMany;
14 import javax.persistence.Table;
15 import org.hibernate.annotations.GenericGenerator;
16
17
18
19
20 @Entity
21 @Table(name = "tb_parametro_par")
22 public class ParametroPar implements java.io.Serializable {
23
24 public static final Long IDENTIFICADOR_ITEM_ESTRUTURA = 1L;
25 public static final Long DATA_ATUAL = 2L;
26 public static final Long DATA_LIMITE_REALIZADO_FISICO = 3L;
27 public static final Long DATA_INICIO_ACOMPANHAMENTO = 4L;
28
29 private Long codParametroPar;
30 private String descricaoPar;
31 private String tabelaPar;
32 private String atributoPar;
33 private Set<ServicoParametroSerPar> servicoParametros = new HashSet<ServicoParametroSerPar>(0);
34
35 public ParametroPar() {
36 }
37
38 public ParametroPar(String descricaoPar, String tabelaPar, String atributoPar, Set<ServicoParametroSerPar> servicoParametros) {
39 this.descricaoPar = descricaoPar;
40 this.tabelaPar = tabelaPar;
41 this.atributoPar = atributoPar;
42 this.servicoParametros = servicoParametros;
43 }
44
45 @GenericGenerator(name = "generator", strategy = "increment")
46 @Id
47 @GeneratedValue(generator = "generator")
48 @Column(name = "cod_parametro_par", nullable = false)
49 public Long getCodParametroPar() {
50 return this.codParametroPar;
51 }
52
53 public void setCodParametroPar(Long codParametroPar) {
54 this.codParametroPar = codParametroPar;
55 }
56
57 @Column(name = "descricao_par", length = 100)
58 public String getDescricaoPar() {
59 return this.descricaoPar;
60 }
61
62 public void setDescricaoPar(String descricaoPar) {
63 this.descricaoPar = descricaoPar;
64 }
65
66 @Column(name = "tabela_par", length = 100)
67 public String getTabelaPar() {
68 return this.tabelaPar;
69 }
70
71 public void setTabelaPar(String tabelaPar) {
72 this.tabelaPar = tabelaPar;
73 }
74
75 @Column(name = "atributo_par", length = 100)
76 public String getAtributoPar() {
77 return this.atributoPar;
78 }
79
80 public void setAtributoPar(String atributoPar) {
81 this.atributoPar = atributoPar;
82 }
83
84 @OneToMany(cascade = CascadeType.REMOVE, fetch = FetchType.LAZY, mappedBy = "parametroPar")
85 public Set<ServicoParametroSerPar> getServicoParametros() {
86 return this.servicoParametros;
87 }
88
89 public void setServicoParametros(Set<ServicoParametroSerPar> servicoParametros) {
90 this.servicoParametros = servicoParametros;
91 }
92
93 }