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_tipoacomp_tipofuncacomp_sisatributo_tatpfasatb")
20 public class TipoAcompTipofuncacompSisatributoTaTpfaSatb implements java.io.Serializable, PaiFilho {
21
22 private static final long serialVersionUID = 1674438276283753309L;
23
24 private TipoAcompTipofuncacompSisatributoTaTpfaSatbId id;
25 private SisAtributoSatb sisAtributoSatb;
26 private TipoFuncAcompTpfa tipoFuncAcompTpfa;
27 private TipoAcompanhamentoTa tipoAcompanhamentoTa;
28 private String indLeituraParecer;
29
30 public TipoAcompTipofuncacompSisatributoTaTpfaSatb() {
31 }
32
33 public TipoAcompTipofuncacompSisatributoTaTpfaSatb(TipoAcompanhamentoTa tipoAcompanhamentoTa, TipoFuncAcompTpfa tipoFuncAcompTpfa, SisAtributoSatb sisAtributoSatb) {
34 this.id = new TipoAcompTipofuncacompSisatributoTaTpfaSatbId(tipoAcompanhamentoTa.getCodTa(),tipoFuncAcompTpfa.getCodTpfa(),sisAtributoSatb.getCodSatb());
35 }
36
37 public TipoAcompTipofuncacompSisatributoTaTpfaSatb(TipoAcompTipofuncacompSisatributoTaTpfaSatbId id, SisAtributoSatb sisAtributoSatb, TipoFuncAcompTpfa tipoFuncAcompTpfa, TipoAcompanhamentoTa tipoAcompanhamentoTa, String indLeituraParecer) {
38 this.id = id;
39 this.sisAtributoSatb = sisAtributoSatb;
40 this.tipoFuncAcompTpfa = tipoFuncAcompTpfa;
41 this.tipoAcompanhamentoTa = tipoAcompanhamentoTa;
42 this.indLeituraParecer = indLeituraParecer;
43 }
44
45 @EmbeddedId
46 @AttributeOverrides( { @AttributeOverride(name = "codTa", column = @Column(name = "cod_ta", nullable = false)), @AttributeOverride(name = "codTpfa", column = @Column(name = "cod_tpfa", nullable = false)), @AttributeOverride(name = "codSatb", column = @Column(name = "cod_satb", nullable = false)) })
47 public TipoAcompTipofuncacompSisatributoTaTpfaSatbId getId() {
48 return this.id;
49 }
50
51 public void setId(TipoAcompTipofuncacompSisatributoTaTpfaSatbId id) {
52 this.id = id;
53 }
54
55 @ManyToOne(fetch = FetchType.LAZY)
56 @JoinColumn(name = "cod_satb", nullable = false, insertable = false, updatable = false)
57 public SisAtributoSatb getSisAtributoSatb() {
58 return this.sisAtributoSatb;
59 }
60
61 public void setSisAtributoSatb(SisAtributoSatb sisAtributoSatb) {
62 this.sisAtributoSatb = sisAtributoSatb;
63 }
64
65 @ManyToOne(fetch = FetchType.LAZY)
66 @JoinColumn(name = "cod_tpfa", nullable = false, insertable = false, updatable = false)
67 public TipoFuncAcompTpfa getTipoFuncAcompTpfa() {
68 return this.tipoFuncAcompTpfa;
69 }
70
71 public void setTipoFuncAcompTpfa(TipoFuncAcompTpfa tipoFuncAcompTpfa) {
72 this.tipoFuncAcompTpfa = tipoFuncAcompTpfa;
73 }
74
75 @ManyToOne(fetch = FetchType.LAZY)
76 @JoinColumn(name = "cod_ta", nullable = false, insertable = false, updatable = false)
77 public TipoAcompanhamentoTa getTipoAcompanhamentoTa() {
78 return this.tipoAcompanhamentoTa;
79 }
80
81 public void setTipoAcompanhamentoTa(TipoAcompanhamentoTa tipoAcompanhamentoTa) {
82 this.tipoAcompanhamentoTa = tipoAcompanhamentoTa;
83 }
84
85 @Column(name = "ind_leitura_parecer", length = 1)
86 public String getIndLeituraParecer() {
87 return this.indLeituraParecer;
88 }
89
90 public void setIndLeituraParecer(String indLeituraParecer) {
91 this.indLeituraParecer = indLeituraParecer;
92 }
93
94 public void atribuirPKPai() {
95 id = new TipoAcompTipofuncacompSisatributoTaTpfaSatbId();
96 id.setCodTa(this.getTipoAcompanhamentoTa().getCodTa());
97 id.setCodTpfa(this.getTipoFuncAcompTpfa().getCodTpfa());
98 id.setCodSatb(this.getSisAtributoSatb().getCodSatb());
99 }
100
101 }