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_item_est_local_rev_iettlr")
23 public class ItemEstLocalRevIettlr implements java.io.Serializable, PaiFilho {
24
25 private static final long serialVersionUID = 600467388225824407L;
26
27 private ItemEstLocalRevIettlrPK comp_id;
28 private Date dataInclusaoIettlr;
29 private LocalItemLit localItemLit;
30 private ItemEstruturarevisaoIettrev itemEstruturarevisaoIettrev;
31
32 public ItemEstLocalRevIettlr() {
33 }
34
35 public ItemEstLocalRevIettlr(ItemEstLocalRevIettlrPK comp_id) {
36 this.comp_id = comp_id;
37 }
38
39 public ItemEstLocalRevIettlr(ItemEstLocalRevIettlrPK comp_id, Date dataInclusaoIettlr, LocalItemLit localItemLit, ItemEstruturarevisaoIettrev itemEstruturarevisaoIettrev) {
40 this.comp_id = comp_id;
41 this.dataInclusaoIettlr = dataInclusaoIettlr;
42 this.localItemLit = localItemLit;
43 this.itemEstruturarevisaoIettrev = itemEstruturarevisaoIettrev;
44 }
45
46 @EmbeddedId
47 @AttributeOverrides( { @AttributeOverride(name = "codLit", column = @Column(name = "cod_lit", nullable = false, length = 4)), @AttributeOverride(name = "codIettrev", column = @Column(name = "cod_iettrev", nullable = false, length = 4)) })
48 public ItemEstLocalRevIettlrPK getComp_id() {
49 return this.comp_id;
50 }
51
52 public void setComp_id(ItemEstLocalRevIettlrPK comp_id) {
53 this.comp_id = comp_id;
54 }
55
56 @Temporal(TemporalType.TIMESTAMP)
57 @Column(name = "data_inclusao_iettlr", length = 4)
58 public Date getDataInclusaoIettlr() {
59 return this.dataInclusaoIettlr;
60 }
61
62 public void setDataInclusaoIettlr(Date dataInclusaoIettlr) {
63 this.dataInclusaoIettlr = dataInclusaoIettlr;
64 }
65
66 @ManyToOne(fetch = FetchType.LAZY)
67 @JoinColumn(name = "cod_lit", insertable = false, updatable = false)
68 public LocalItemLit getLocalItemLit() {
69 return this.localItemLit;
70 }
71
72 public void setLocalItemLit(LocalItemLit localItemLit) {
73 this.localItemLit = localItemLit;
74 }
75
76 @ManyToOne(fetch = FetchType.LAZY)
77 @JoinColumn(name = "cod_iettrev", insertable = false, updatable = false)
78 public ItemEstruturarevisaoIettrev getItemEstruturarevisaoIettrev() {
79 return this.itemEstruturarevisaoIettrev;
80 }
81
82 public void setItemEstruturarevisaoIettrev(ItemEstruturarevisaoIettrev itemEstruturarevisaoIettrev) {
83 this.itemEstruturarevisaoIettrev = itemEstruturarevisaoIettrev;
84 }
85
86 public void atribuirPKPai() {
87 comp_id = new ItemEstLocalRevIettlrPK();
88 comp_id.setCodIettrev(this.getItemEstruturarevisaoIettrev().getNivelIettrev());
89 comp_id.setCodLit(this.getLocalItemLit().getCodLit());
90 }
91
92 }