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
16
17
18
19 @Entity
20 @Table(name = "TB_ITEM_ESTRUT_LOCAL_IETTL")
21 public class ItemEstrutLocalIettl implements java.io.Serializable, PaiFilho {
22
23 private static final long serialVersionUID = -6830355674341972038L;
24
25 private ItemEstrutLocalIettlPK comp_id;
26 private Date dataInclusaoIettl;
27 private Boolean indExclusaoPosHistorico;
28 private ItemEstruturaIett itemEstruturaIett;
29 private LocalItemLit localItemLit;
30 private UsuarioUsu usuarioUsuManutencao;
31
32 public ItemEstrutLocalIettl() {
33 }
34
35 public ItemEstrutLocalIettl(ItemEstrutLocalIettlPK comp_id) {
36 this.comp_id = comp_id;
37 }
38
39 public ItemEstrutLocalIettl(ItemEstrutLocalIettlPK comp_id, Date dataInclusaoIettl, Boolean indExclusaoPosHistorico, ItemEstruturaIett itemEstruturaIett, LocalItemLit localItemLit, UsuarioUsu usuarioUsuManutencao) {
40 this.comp_id = comp_id;
41 this.dataInclusaoIettl = dataInclusaoIettl;
42 this.indExclusaoPosHistorico = indExclusaoPosHistorico;
43 this.itemEstruturaIett = itemEstruturaIett;
44 this.localItemLit = localItemLit;
45 this.usuarioUsuManutencao = usuarioUsuManutencao;
46 }
47
48 @EmbeddedId
49 @AttributeOverrides( { @AttributeOverride(name = "codLit", column = @Column(name = "COD_LIT", nullable = false, length = 10)), @AttributeOverride(name = "codIett", column = @Column(name = "COD_IETT", nullable = false, length = 10)) })
50 public ItemEstrutLocalIettlPK getComp_id() {
51 return this.comp_id;
52 }
53
54 public void setComp_id(ItemEstrutLocalIettlPK comp_id) {
55 this.comp_id = comp_id;
56 }
57
58 @Column(name = "DATA_INCLUSAO_IETTL", length = 7)
59 public Date getDataInclusaoIettl() {
60 return this.dataInclusaoIettl;
61 }
62
63 public void setDataInclusaoIettl(Date dataInclusaoIettl) {
64 this.dataInclusaoIettl = dataInclusaoIettl;
65 }
66
67 @Column(name = "IND_EXCLUSAO_POS_HISTORICO")
68 public Boolean getIndExclusaoPosHistorico() {
69 return this.indExclusaoPosHistorico;
70 }
71
72 public void setIndExclusaoPosHistorico(Boolean indExclusaoPosHistorico) {
73 this.indExclusaoPosHistorico = indExclusaoPosHistorico;
74 }
75
76 @ManyToOne(fetch = FetchType.LAZY)
77 @JoinColumn(name = "COD_IETT", insertable = false, updatable = false)
78 public ItemEstruturaIett getItemEstruturaIett() {
79 return this.itemEstruturaIett;
80 }
81
82 public void setItemEstruturaIett(ItemEstruturaIett itemEstruturaIett) {
83 this.itemEstruturaIett = itemEstruturaIett;
84 }
85
86 @ManyToOne(fetch = FetchType.LAZY)
87 @JoinColumn(name = "COD_LIT", insertable = false, updatable = false)
88 public LocalItemLit getLocalItemLit() {
89 return this.localItemLit;
90 }
91
92 public void setLocalItemLit(LocalItemLit localItemLit) {
93 this.localItemLit = localItemLit;
94 }
95
96 @ManyToOne(fetch = FetchType.LAZY)
97 @JoinColumn(name = "COD_USU_MANUTENCAO")
98 public UsuarioUsu getUsuarioUsuManutencao() {
99 return this.usuarioUsuManutencao;
100 }
101
102 public void setUsuarioUsuManutencao(UsuarioUsu usuarioUsuManutencao) {
103 this.usuarioUsuManutencao = usuarioUsuManutencao;
104 }
105
106 public void atribuirPKPai() {
107 comp_id = new ItemEstrutLocalIettlPK();
108 comp_id.setCodIett(this.getItemEstruturaIett().getCodIett());
109 comp_id.setCodLit(this.getLocalItemLit().getCodLit());
110 }
111
112 }