1 package ecar.pojo;
2
3
4
5 import javax.persistence.AttributeOverride;
6 import javax.persistence.AttributeOverrides;
7 import javax.persistence.Column;
8 import javax.persistence.EmbeddedId;
9 import javax.persistence.Entity;
10 import javax.persistence.FetchType;
11 import javax.persistence.JoinColumn;
12 import javax.persistence.ManyToOne;
13 import javax.persistence.Table;
14
15
16
17
18 @Entity
19 @Table(name = "TB_ESTRUTURA_ACESSO_ETTA")
20 public class EstruturaAcessoEtta implements java.io.Serializable, PaiFilho{
21
22 private static final long serialVersionUID = 8345183529768802404L;
23
24 public final static String COM_ACESSO_INCLUSAO = "S";
25 public final static String SEM_ACESSO_INCLUSAO = "N";
26
27 private EstruturaAcessoEttaPK comp_id;
28 private String indIncItemEtta;
29 private String indIncAcompMonitoradoEtta;
30 private String indIncAcompSecoutrEtta;
31 private String indIncAcompSecpropEtta;
32 private String indLeiAcompSecoutrEtta;
33 private String indLeiAcompSecpropEtta;
34 private String indLeiAcompMoniProprEtta;
35 private String indLeiAcompMoniSecOutEtta;
36 private String indLeiAcompMoniSecProEtta;
37 private String indLeiAcompSuaResponsEtta;
38 private EstruturaEtt estruturaEtt;
39 private SisAtributoSatb sisAtributoSatb;
40
41 public EstruturaAcessoEtta() {
42 }
43
44 public EstruturaAcessoEtta(EstruturaAcessoEttaPK comp_id) {
45 this.comp_id = comp_id;
46 }
47
48 public EstruturaAcessoEtta(EstruturaAcessoEttaPK comp_id, String indIncItemEtta, String indIncAcompMonitoradoEtta, String indIncAcompSecoutrEtta, String indIncAcompSecpropEtta, String indLeiAcompSecoutrEtta, String indLeiAcompSecpropEtta, String indLeiAcompMoniProprEtta, String indLeiAcompMoniSecOutEtta, String indLeiAcompMoniSecProEtta, String indLeiAcompSuaResponsEtta, EstruturaEtt estruturaEtt, SisAtributoSatb sisAtributoSatb) {
49 this.comp_id = comp_id;
50 this.indIncItemEtta = indIncItemEtta;
51 this.indIncAcompMonitoradoEtta = indIncAcompMonitoradoEtta;
52 this.indIncAcompSecoutrEtta = indIncAcompSecoutrEtta;
53 this.indIncAcompSecpropEtta = indIncAcompSecpropEtta;
54 this.indLeiAcompSecoutrEtta = indLeiAcompSecoutrEtta;
55 this.indLeiAcompSecpropEtta = indLeiAcompSecpropEtta;
56 this.indLeiAcompMoniProprEtta = indLeiAcompMoniProprEtta;
57 this.indLeiAcompMoniSecOutEtta = indLeiAcompMoniSecOutEtta;
58 this.indLeiAcompMoniSecProEtta = indLeiAcompMoniSecProEtta;
59 this.indLeiAcompSuaResponsEtta = indLeiAcompSuaResponsEtta;
60 this.estruturaEtt = estruturaEtt;
61 this.sisAtributoSatb = sisAtributoSatb;
62 }
63
64 public EstruturaAcessoEtta(SisAtributoSatb sisAtributoSatb,EstruturaEtt estruturaEtt) {
65 this.comp_id = new EstruturaAcessoEttaPK(estruturaEtt.getCodEtt(),sisAtributoSatb.getCodSatb());
66 }
67
68 @EmbeddedId
69 @AttributeOverrides( { @AttributeOverride(name = "codEtt", column = @Column(name = "COD_ETT", nullable = false, length = 10)), @AttributeOverride(name = "codAtb", column = @Column(name = "COD_ATB", nullable = false, length = 10)) })
70 public EstruturaAcessoEttaPK getComp_id() {
71 return this.comp_id;
72 }
73
74 public void setComp_id(EstruturaAcessoEttaPK comp_id) {
75 this.comp_id = comp_id;
76 }
77
78 @Column(name = "IND_INC_ITEM_ETTA", length = 1)
79 public String getIndIncItemEtta() {
80 return this.indIncItemEtta;
81 }
82
83 public void setIndIncItemEtta(String indIncItemEtta) {
84 this.indIncItemEtta = indIncItemEtta;
85 }
86
87 @Column(name = "IND_INC_ACOMP_MONITORADO_ETTA", length = 1)
88 public String getIndIncAcompMonitoradoEtta() {
89 return this.indIncAcompMonitoradoEtta;
90 }
91
92 public void setIndIncAcompMonitoradoEtta(String indIncAcompMonitoradoEtta) {
93 this.indIncAcompMonitoradoEtta = indIncAcompMonitoradoEtta;
94 }
95
96 @Column(name = "IND_INC_ACOMP_SECOUTR_ETTA", length = 1)
97 public String getIndIncAcompSecoutrEtta() {
98 return this.indIncAcompSecoutrEtta;
99 }
100
101 public void setIndIncAcompSecoutrEtta(String indIncAcompSecoutrEtta) {
102 this.indIncAcompSecoutrEtta = indIncAcompSecoutrEtta;
103 }
104
105 @Column(name = "IND_INC_ACOMP_SECPROP_ETTA", length = 1)
106 public String getIndIncAcompSecpropEtta() {
107 return this.indIncAcompSecpropEtta;
108 }
109
110 public void setIndIncAcompSecpropEtta(String indIncAcompSecpropEtta) {
111 this.indIncAcompSecpropEtta = indIncAcompSecpropEtta;
112 }
113
114 @Column(name = "IND_LEI_ACOMP_SECOUT_ETTA", length = 1)
115 public String getIndLeiAcompSecoutrEtta() {
116 return this.indLeiAcompSecoutrEtta;
117 }
118
119 public void setIndLeiAcompSecoutrEtta(String indLeiAcompSecoutrEtta) {
120 this.indLeiAcompSecoutrEtta = indLeiAcompSecoutrEtta;
121 }
122
123 @Column(name = "IND_LEI_ACOMP_SECPROP_ETTA", length = 1)
124 public String getIndLeiAcompSecpropEtta() {
125 return this.indLeiAcompSecpropEtta;
126 }
127
128 public void setIndLeiAcompSecpropEtta(String indLeiAcompSecpropEtta) {
129 this.indLeiAcompSecpropEtta = indLeiAcompSecpropEtta;
130 }
131
132 @Column(name = "IND_LEI_ACOMP_MONI_PROPR_ETTA", length = 1)
133 public String getIndLeiAcompMoniProprEtta() {
134 return this.indLeiAcompMoniProprEtta;
135 }
136
137 public void setIndLeiAcompMoniProprEtta(String indLeiAcompMoniProprEtta) {
138 this.indLeiAcompMoniProprEtta = indLeiAcompMoniProprEtta;
139 }
140
141 @Column(name = "IND_LEI_ACOMP_MONI_SECOUT_ETTA", length = 1)
142 public String getIndLeiAcompMoniSecOutEtta() {
143 return this.indLeiAcompMoniSecOutEtta;
144 }
145
146 public void setIndLeiAcompMoniSecOutEtta(String indLeiAcompMoniSecOutEtta) {
147 this.indLeiAcompMoniSecOutEtta = indLeiAcompMoniSecOutEtta;
148 }
149
150 @Column(name = "IND_LEI_ACOMP_MONI_SECPRO_ETTA", length = 1)
151 public String getIndLeiAcompMoniSecProEtta() {
152 return this.indLeiAcompMoniSecProEtta;
153 }
154
155 public void setIndLeiAcompMoniSecProEtta(String indLeiAcompMoniSecProEtta) {
156 this.indLeiAcompMoniSecProEtta = indLeiAcompMoniSecProEtta;
157 }
158
159 @Column(name = "IND_LEI_ACOMP_SUARESPONS_ETTA", length = 1)
160 public String getIndLeiAcompSuaResponsEtta() {
161 return this.indLeiAcompSuaResponsEtta;
162 }
163
164 public void setIndLeiAcompSuaResponsEtta(String indLeiAcompSuaResponsEtta) {
165 this.indLeiAcompSuaResponsEtta = indLeiAcompSuaResponsEtta;
166 }
167
168 @ManyToOne(fetch = FetchType.LAZY)
169 @JoinColumn(name = "COD_ETT", insertable = false, updatable = false)
170 public EstruturaEtt getEstruturaEtt() {
171 return this.estruturaEtt;
172 }
173
174 public void setEstruturaEtt(EstruturaEtt estruturaEtt) {
175 this.estruturaEtt = estruturaEtt;
176 }
177
178 @ManyToOne(fetch = FetchType.LAZY)
179 @JoinColumn(name = "COD_ATB", insertable = false, updatable = false)
180 public SisAtributoSatb getSisAtributoSatb() {
181 return this.sisAtributoSatb;
182 }
183
184 public void setSisAtributoSatb(SisAtributoSatb sisAtributoSatb) {
185 this.sisAtributoSatb = sisAtributoSatb;
186 }
187
188
189 public void atribuirPKPai() {
190 comp_id = new EstruturaAcessoEttaPK();
191 comp_id.setCodEtt(this.getEstruturaEtt().getCodEtt());
192 comp_id.setCodAtb(this.getSisAtributoSatb().getCodSatb());
193
194 }
195
196
197 }