1 package ecar.pojo;
2
3
4
5 import java.util.Date;
6 import java.util.HashSet;
7 import java.util.Set;
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.JoinColumn;
14 import javax.persistence.JoinTable;
15 import javax.persistence.ManyToMany;
16 import javax.persistence.ManyToOne;
17 import javax.persistence.OneToMany;
18 import javax.persistence.Table;
19 import javax.persistence.Temporal;
20 import javax.persistence.TemporalType;
21 import org.hibernate.annotations.Cascade;
22 import org.hibernate.annotations.CascadeType;
23 import org.hibernate.annotations.GenericGenerator;
24
25
26
27
28 @Entity
29 @Table(name = "TB_SEGMENTO_CATEGORIA_SGTC")
30 public class SegmentoCategoriaSgtc implements java.io.Serializable {
31
32 private Long codSgtc;
33 private Date dataInclusaoSgtc;
34 private String indAtivoSgtc;
35 private String legImagemSgtc;
36 private String imagemSgtc;
37 private String descricaoSgtc;
38 private String tituloSgtc;
39 private String indUtilizTpAcessoSgtc;
40 private Set<SisAtributoSatb> segmentoCategTpAcessSgts = new HashSet<SisAtributoSatb>(0);
41 private Set<SegmentoItemSgti> segmentoItemSgtis = new HashSet<SegmentoItemSgti>(0);
42 private UsuarioUsu usuarioUsu;
43 private SegmentoSgt segmentoSgt;
44
45 public SegmentoCategoriaSgtc() {
46 }
47
48 public SegmentoCategoriaSgtc(Date dataInclusaoSgtc, String indAtivoSgtc, String legImagemSgtc, String imagemSgtc, String descricaoSgtc, String tituloSgtc, String indUtilizTpAcessoSgtc, Set<SisAtributoSatb> segmentoCategTpAcessSgts, Set<SegmentoItemSgti> segmentoItemSgtis, UsuarioUsu usuarioUsu, SegmentoSgt segmentoSgt) {
49 this.dataInclusaoSgtc = dataInclusaoSgtc;
50 this.indAtivoSgtc = indAtivoSgtc;
51 this.legImagemSgtc = legImagemSgtc;
52 this.imagemSgtc = imagemSgtc;
53 this.descricaoSgtc = descricaoSgtc;
54 this.tituloSgtc = tituloSgtc;
55 this.indUtilizTpAcessoSgtc = indUtilizTpAcessoSgtc;
56 this.segmentoCategTpAcessSgts = segmentoCategTpAcessSgts;
57 this.segmentoItemSgtis = segmentoItemSgtis;
58 this.usuarioUsu = usuarioUsu;
59 this.segmentoSgt = segmentoSgt;
60 }
61
62 @GenericGenerator(name = "generator", strategy = "increment")
63 @Id
64 @GeneratedValue(generator = "generator")
65 @Column(name = "COD_SGTC", nullable = false)
66 public Long getCodSgtc() {
67 return this.codSgtc;
68 }
69
70 public void setCodSgtc(Long codSgtc) {
71 this.codSgtc = codSgtc;
72 }
73
74 @Temporal(TemporalType.TIMESTAMP)
75 @Column(name = "DATA_INCLUSAO_SGTC", length = 7)
76 public Date getDataInclusaoSgtc() {
77 return this.dataInclusaoSgtc;
78 }
79
80 public void setDataInclusaoSgtc(Date dataInclusaoSgtc) {
81 this.dataInclusaoSgtc = dataInclusaoSgtc;
82 }
83
84 @Column(name = "IND_ATIVO_SGTC", length = 1)
85 public String getIndAtivoSgtc() {
86 return this.indAtivoSgtc;
87 }
88
89 public void setIndAtivoSgtc(String indAtivoSgtc) {
90 this.indAtivoSgtc = indAtivoSgtc;
91 }
92
93 @Column(name = "LEG_IMAGEM_SGTC", length = 20)
94 public String getLegImagemSgtc() {
95 return this.legImagemSgtc;
96 }
97
98 public void setLegImagemSgtc(String legImagemSgtc) {
99 this.legImagemSgtc = legImagemSgtc;
100 }
101
102 @Column(name = "IMAGEM_SGTC", length = 100)
103 public String getImagemSgtc() {
104 return this.imagemSgtc;
105 }
106
107 public void setImagemSgtc(String imagemSgtc) {
108 this.imagemSgtc = imagemSgtc;
109 }
110
111 @Column(name = "DESCRICAO_SGTC", length = 2000)
112 public String getDescricaoSgtc() {
113 return this.descricaoSgtc;
114 }
115
116 public void setDescricaoSgtc(String descricaoSgtc) {
117 this.descricaoSgtc = descricaoSgtc;
118 }
119
120 @Column(name = "TITULO_SGTC", length = 200)
121 public String getTituloSgtc() {
122 return this.tituloSgtc;
123 }
124
125 public void setTituloSgtc(String tituloSgtc) {
126 this.tituloSgtc = tituloSgtc;
127 }
128
129 @Column(name = "IND_UTILIZ_TP_ACESSO_SGTC", length = 1)
130 public String getIndUtilizTpAcessoSgtc() {
131 return this.indUtilizTpAcessoSgtc;
132 }
133
134 public void setIndUtilizTpAcessoSgtc(String indUtilizTpAcessoSgtc) {
135 this.indUtilizTpAcessoSgtc = indUtilizTpAcessoSgtc;
136 }
137
138 @ManyToMany(fetch = FetchType.LAZY)
139 @JoinTable(name = "TB_SEGMENTO_CATEG_TP_ACESS_SGT", joinColumns = { @JoinColumn(name = "COD_SGTC", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "COD_SATB", nullable = false, updatable = false) })
140 @Cascade( { CascadeType.SAVE_UPDATE })
141 public Set<SisAtributoSatb> getSegmentoCategTpAcessSgts() {
142 return this.segmentoCategTpAcessSgts;
143 }
144
145 public void setSegmentoCategTpAcessSgts(Set<SisAtributoSatb> segmentoCategTpAcessSgts) {
146 this.segmentoCategTpAcessSgts = segmentoCategTpAcessSgts;
147 }
148
149 @OneToMany(fetch = FetchType.LAZY, mappedBy = "segmentoCategoriaSgtc")
150 public Set<SegmentoItemSgti> getSegmentoItemSgtis() {
151 return this.segmentoItemSgtis;
152 }
153
154 public void setSegmentoItemSgtis(Set<SegmentoItemSgti> segmentoItemSgtis) {
155 this.segmentoItemSgtis = segmentoItemSgtis;
156 }
157
158 @ManyToOne(fetch = FetchType.LAZY)
159 @JoinColumn(name = "COD_USU")
160 public UsuarioUsu getUsuarioUsu() {
161 return this.usuarioUsu;
162 }
163
164 public void setUsuarioUsu(UsuarioUsu usuarioUsu) {
165 this.usuarioUsu = usuarioUsu;
166 }
167
168 @ManyToOne(fetch = FetchType.LAZY)
169 @JoinColumn(name = "COD_SGT")
170 public SegmentoSgt getSegmentoSgt() {
171 return this.segmentoSgt;
172 }
173
174 public void setSegmentoSgt(SegmentoSgt segmentoSgt) {
175 this.segmentoSgt = segmentoSgt;
176 }
177
178 }