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_ACOMP_REF_LIMITES_ARL")
23 public class AcompRefLimitesArl implements java.io.Serializable, PaiFilho {
24
25 private static final long serialVersionUID = 9033090810919157187L;
26
27 private AcompRefLimitesArlPK comp_id;
28 private Date dataLimiteArl;
29 private TipoFuncAcompTpfa tipoFuncAcompTpfa;
30 private AcompReferenciaAref acompReferenciaAref;
31
32 public AcompRefLimitesArl() {
33 }
34
35 public AcompRefLimitesArl(AcompRefLimitesArlPK comp_id) {
36 this.comp_id = comp_id;
37 }
38
39 public AcompRefLimitesArl(AcompRefLimitesArlPK comp_id, Date dataLimiteArl, TipoFuncAcompTpfa tipoFuncAcompTpfa, AcompReferenciaAref acompReferenciaAref) {
40 this.comp_id = comp_id;
41 this.dataLimiteArl = dataLimiteArl;
42 this.tipoFuncAcompTpfa = tipoFuncAcompTpfa;
43 this.acompReferenciaAref = acompReferenciaAref;
44 }
45
46 @EmbeddedId
47 @AttributeOverrides( { @AttributeOverride(name = "codAref", column = @Column(name = "COD_AREF", nullable = false, length = 10)), @AttributeOverride(name = "codTpfa", column = @Column(name = "COD_TPFA", nullable = false, length = 10)) })
48 public AcompRefLimitesArlPK getComp_id() {
49 return this.comp_id;
50 }
51
52 public void setComp_id(AcompRefLimitesArlPK comp_id) {
53 this.comp_id = comp_id;
54 }
55
56 @Temporal(TemporalType.TIMESTAMP)
57 @Column(name = "DATA_LIMITE_ARL", length = 7)
58 public Date getDataLimiteArl() {
59 return this.dataLimiteArl;
60 }
61
62 public void setDataLimiteArl(Date dataLimiteArl) {
63 this.dataLimiteArl = dataLimiteArl;
64 }
65
66 @ManyToOne(fetch = FetchType.LAZY)
67 @JoinColumn(name = "COD_TPFA", insertable = false, updatable = false)
68 public TipoFuncAcompTpfa getTipoFuncAcompTpfa() {
69 return this.tipoFuncAcompTpfa;
70 }
71
72 public void setTipoFuncAcompTpfa(TipoFuncAcompTpfa tipoFuncAcompTpfa) {
73 this.tipoFuncAcompTpfa = tipoFuncAcompTpfa;
74 }
75
76 @ManyToOne(fetch = FetchType.LAZY)
77 @JoinColumn(name = "COD_AREF", insertable = false, updatable = false)
78 public AcompReferenciaAref getAcompReferenciaAref() {
79 return this.acompReferenciaAref;
80 }
81
82 public void setAcompReferenciaAref(AcompReferenciaAref acompReferenciaAref) {
83 this.acompReferenciaAref = acompReferenciaAref;
84 }
85
86
87 public void atribuirPKPai() {
88 comp_id = new AcompRefLimitesArlPK();
89 comp_id.setCodAref(this.getAcompReferenciaAref().getCodAref());
90 comp_id.setCodTpfa(this.getTipoFuncAcompTpfa().getCodTpfa());
91 }
92
93 }
94
95