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_poder_periodo_exercicio_podperexe")
20 public class PoderPeriodoExercicioPodPerExe implements java.io.Serializable, PaiFilho {
21
22 private static final long serialVersionUID = -5179360755699859561L;
23
24 private PoderPeriodoExercicioPodPerExePK compId;
25 private String indAtivoPodPerExe;
26 private PoderPod poderPod;
27 private PeriodoExercicioPerExe periodoExercicioPerExe;
28
29 public PoderPeriodoExercicioPodPerExe() {
30 }
31
32 public PoderPeriodoExercicioPodPerExe(PoderPeriodoExercicioPodPerExePK compId) {
33 this.compId = compId;
34 }
35
36 public PoderPeriodoExercicioPodPerExe(PoderPeriodoExercicioPodPerExePK compId, String indAtivoPodPerExe, PoderPod poderPod, PeriodoExercicioPerExe periodoExercicioPerExe) {
37 this.compId = compId;
38 this.indAtivoPodPerExe = indAtivoPodPerExe;
39 this.poderPod = poderPod;
40 this.periodoExercicioPerExe = periodoExercicioPerExe;
41 }
42
43 @EmbeddedId
44 @AttributeOverrides( { @AttributeOverride(name = "codPod", column = @Column(name = "cod_pod", nullable = false, length = 10)), @AttributeOverride(name = "codPerExe", column = @Column(name = "cod_perexe", nullable = false, length = 10)) })
45 public PoderPeriodoExercicioPodPerExePK getCompId() {
46 return this.compId;
47 }
48
49 public void setCompId(PoderPeriodoExercicioPodPerExePK compId) {
50 this.compId = compId;
51 }
52
53 @Column(name = "ind_ativo_podperexe", length = 1)
54 public String getIndAtivoPodPerExe() {
55 return this.indAtivoPodPerExe;
56 }
57
58 public void setIndAtivoPodPerExe(String indAtivoPodPerExe) {
59 this.indAtivoPodPerExe = indAtivoPodPerExe;
60 }
61
62 @ManyToOne(fetch = FetchType.LAZY)
63 @JoinColumn(name = "cod_pod", insertable = false, updatable = false)
64 public PoderPod getPoderPod() {
65 return this.poderPod;
66 }
67
68 public void setPoderPod(PoderPod poderPod) {
69 this.poderPod = poderPod;
70 }
71
72 @ManyToOne(fetch = FetchType.LAZY)
73 @JoinColumn(name = "cod_perexe", insertable = false, updatable = false)
74 public PeriodoExercicioPerExe getPeriodoExercicioPerExe() {
75 return this.periodoExercicioPerExe;
76 }
77
78 public void setPeriodoExercicioPerExe(PeriodoExercicioPerExe periodoExercicioPerExe) {
79 this.periodoExercicioPerExe = periodoExercicioPerExe;
80 }
81
82 public void atribuirPKPai() {
83 compId = new PoderPeriodoExercicioPodPerExePK();
84 compId.setCodPerExe(this.getPeriodoExercicioPerExe().getCodPerExe());
85 compId.setCodPod(this.getPoderPod().getCodPod());
86 }
87
88 }