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_USUARIO_ATRIBUTO_USUA")
23 public class UsuarioAtributoUsua implements java.io.Serializable, PaiFilho {
24
25 private static final long serialVersionUID = -518325988185699207L;
26
27 private UsuarioAtributoUsuaPK comp_id;
28 private Date dataInclusao;
29 private String informacao;
30 private SisAtributoSatb sisAtributoSatb;
31 private UsuarioUsu usuarioUsu;
32
33 public UsuarioAtributoUsua() {
34 }
35
36 public UsuarioAtributoUsua(UsuarioAtributoUsuaPK comp_id) {
37 this.comp_id = comp_id;
38 }
39
40 public UsuarioAtributoUsua(UsuarioAtributoUsuaPK comp_id, Date dataInclusao, String informacao, SisAtributoSatb sisAtributoSatb, UsuarioUsu usuarioUsu) {
41 this.comp_id = comp_id;
42 this.dataInclusao = dataInclusao;
43 this.informacao = informacao;
44 this.sisAtributoSatb = sisAtributoSatb;
45 this.usuarioUsu = usuarioUsu;
46 }
47
48 @EmbeddedId
49 @AttributeOverrides( { @AttributeOverride(name = "codUsu", column = @Column(name = "COD_USU", nullable = false, length = 10)), @AttributeOverride(name = "codSatb", column = @Column(name = "COD_SATB", nullable = false, length = 10)) })
50 public UsuarioAtributoUsuaPK getComp_id() {
51 return this.comp_id;
52 }
53
54 public void setComp_id(UsuarioAtributoUsuaPK comp_id) {
55 this.comp_id = comp_id;
56 }
57
58 @Temporal(TemporalType.TIMESTAMP)
59 @Column(name = "DATA_INCLUSAO_USUA", 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_USUA", 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_SATB", insertable = false, updatable = false)
79 public SisAtributoSatb getSisAtributoSatb() {
80 return this.sisAtributoSatb;
81 }
82
83 public void setSisAtributoSatb(SisAtributoSatb sisAtributoSatb) {
84 this.sisAtributoSatb = sisAtributoSatb;
85 }
86
87 @ManyToOne(fetch = FetchType.LAZY)
88 @JoinColumn(name = "COD_USU", insertable = false, updatable = false)
89 public UsuarioUsu getUsuarioUsu() {
90 return this.usuarioUsu;
91 }
92
93 public void setUsuarioUsu(UsuarioUsu usuarioUsu) {
94 this.usuarioUsu = usuarioUsu;
95 }
96
97 public void atribuirPKPai() {
98 comp_id = new UsuarioAtributoUsuaPK();
99 comp_id.setCodUsu(this.getUsuarioUsu().getCodUsu());
100 comp_id.setCodSatb(this.getSisAtributoSatb().getCodSatb());
101 }
102
103
104 }