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_SEGMENTO_CATEG_TP_ACESS_SGT")
20 public class SegmentoCategoriaTpAcesSgt implements java.io.Serializable, PaiFilho {
21
22 private static final long serialVersionUID = -2017830096735341660L;
23
24 private SegmentoCategoriaTpAcesSgtPK comp_id;
25 private SisAtributoSatb sisAtributoSatb;
26 private SegmentoCategoriaSgtc SegmentoCategoriaSgtc;
27
28 public SegmentoCategoriaTpAcesSgt() {
29 }
30
31 public SegmentoCategoriaTpAcesSgt(SegmentoCategoriaTpAcesSgtPK comp_id) {
32 this.comp_id = comp_id;
33 }
34
35 public SegmentoCategoriaTpAcesSgt(SegmentoCategoriaTpAcesSgtPK comp_id, SisAtributoSatb sisAtributoSatb, SegmentoCategoriaSgtc SegmentoCategoriaSgtc) {
36 this.comp_id = comp_id;
37 this.sisAtributoSatb = sisAtributoSatb;
38 this.SegmentoCategoriaSgtc = SegmentoCategoriaSgtc;
39 }
40
41 @EmbeddedId
42 @AttributeOverrides( { @AttributeOverride(name = "codSgtc", column = @Column(name = "COD_SGTC", nullable = false, length = 10)), @AttributeOverride(name = "codSatb", column = @Column(name = "COD_SATB", nullable = false, length = 10)) })
43 public SegmentoCategoriaTpAcesSgtPK getComp_id() {
44 return this.comp_id;
45 }
46
47 public void setComp_id(SegmentoCategoriaTpAcesSgtPK comp_id) {
48 this.comp_id = comp_id;
49 }
50
51 @ManyToOne(fetch = FetchType.LAZY)
52 @JoinColumn(name = "COD_SATB", insertable = false, updatable = false)
53 public SisAtributoSatb getSisAtributoSatb() {
54 return this.sisAtributoSatb;
55 }
56
57 public void setSisAtributoSatb(SisAtributoSatb sisAtributoSatb) {
58 this.sisAtributoSatb = sisAtributoSatb;
59 }
60
61 @ManyToOne(fetch = FetchType.LAZY)
62 @JoinColumn(name = "COD_SGTC", insertable = false, updatable = false)
63 public SegmentoCategoriaSgtc getSegmentoCategoriaSgtc() {
64 return this.SegmentoCategoriaSgtc;
65 }
66
67 public void setSegmentoCategoriaSgtc(SegmentoCategoriaSgtc SegmentoCategoriaSgtc) {
68 this.SegmentoCategoriaSgtc = SegmentoCategoriaSgtc;
69 }
70
71 public void atribuirPKPai() {
72 comp_id = new SegmentoCategoriaTpAcesSgtPK();
73 comp_id.setCodSatb(this.getSisAtributoSatb().getCodSatb());
74 comp_id.setCodSgtc(this.getSegmentoCategoriaSgtc().getCodSgtc());
75 }
76
77 }