1 package ecar.pojo;
2
3
4
5 import java.util.Date;
6 import javax.persistence.AttributeOverride;
7 import javax.persistence.AttributeOverrides;
8 import javax.persistence.Column;
9 import javax.persistence.EmbeddedId;
10 import javax.persistence.Entity;
11 import javax.persistence.FetchType;
12 import javax.persistence.JoinColumn;
13 import javax.persistence.ManyToOne;
14 import javax.persistence.Table;
15 import javax.persistence.Temporal;
16 import javax.persistence.TemporalType;
17
18
19
20
21 @Entity
22 @Table(name = "TB_DEM_ATRIBUTO_DEMA")
23 public class DemAtributoDema implements java.io.Serializable, PaiFilho {
24
25 private static final long serialVersionUID = 2737303268618202075L;
26
27 private DemAtributoDemaPK comp_id;
28 private Date dataInclusao;
29 private String informacao;
30 private RegDemandaRegd regDemandaRegd;
31 private SisAtributoSatb sisAtributoSatb;
32
33 public DemAtributoDema() {
34 }
35
36 public DemAtributoDema(DemAtributoDemaPK comp_id) {
37 this.comp_id = comp_id;
38 }
39
40 public DemAtributoDema(DemAtributoDemaPK comp_id, Date dataInclusao, String informacao, RegDemandaRegd regDemandaRegd, SisAtributoSatb sisAtributoSatb) {
41 this.comp_id = comp_id;
42 this.dataInclusao = dataInclusao;
43 this.informacao = informacao;
44 this.regDemandaRegd = regDemandaRegd;
45 this.sisAtributoSatb = sisAtributoSatb;
46 }
47
48 @EmbeddedId
49 @AttributeOverrides( { @AttributeOverride(name = "codSatb", column = @Column(name = "COD_SATB", nullable = false, length = 10)), @AttributeOverride(name = "codRegd", column = @Column(name = "COD_REGD", nullable = false, length = 10)) })
50 public DemAtributoDemaPK getComp_id() {
51 return this.comp_id;
52 }
53
54 public void setComp_id(DemAtributoDemaPK comp_id) {
55 this.comp_id = comp_id;
56 }
57
58 @Temporal(TemporalType.TIMESTAMP)
59 @Column(name = "DATA_INCLUSAO_DEMA", length = 7)
60 public Date getDataInclusao() {
61 return this.dataInclusao;
62 }
63
64 public void setDataInclusao(Date dataInclusao) {
65 this.dataInclusao = dataInclusao;
66 }
67
68 @Column(name = "INFORMACAO_DEMA", length = 200)
69 public String getInformacao() {
70 return this.informacao;
71 }
72
73 public void setInformacao(String informacao) {
74 this.informacao = informacao;
75 }
76
77 @ManyToOne(fetch = FetchType.LAZY)
78 @JoinColumn(name = "COD_REGD", insertable = false, updatable = false)
79 public RegDemandaRegd getRegDemandaRegd() {
80 return this.regDemandaRegd;
81 }
82
83 public void setRegDemandaRegd(RegDemandaRegd regDemandaRegd) {
84 this.regDemandaRegd = regDemandaRegd;
85 }
86
87 @ManyToOne(fetch = FetchType.LAZY)
88 @JoinColumn(name = "COD_SATB", insertable = false, updatable = false)
89 public SisAtributoSatb getSisAtributoSatb() {
90 return this.sisAtributoSatb;
91 }
92
93 public void setSisAtributoSatb(SisAtributoSatb sisAtributoSatb) {
94 this.sisAtributoSatb = sisAtributoSatb;
95 }
96
97
98 public void atribuirPKPai() {
99 comp_id = new DemAtributoDemaPK();
100 comp_id.setCodRegd(this.getRegDemandaRegd().getCodRegd());
101 comp_id.setCodSatb(this.getSisAtributoSatb().getCodSatb());
102 }
103
104 }