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 import org.apache.commons.lang.builder.EqualsBuilder;
17 import org.apache.commons.lang.builder.ToStringBuilder;
18
19
20
21
22 @Entity
23 @Table(name = "TB_ITEMESTRUTURA_SISATRIBUTO_IETTSATB")
24 public class ItemEstruturaSisAtributoIettSatb implements java.io.Serializable, PaiFilho {
25
26 private static final long serialVersionUID = -507793941465642376L;
27
28 private ItemEstruturaSisAtributoIettSatbPK comp_id;
29 private String informacaoIettSatb;
30 private Date dataUltManutencaoIettSatb;
31 private Boolean indExclusaoPosHistorico;
32 private ItemEstruturaIett itemEstruturaIett;
33 private ItemEstruturaIettPPA itemEstruturaIettPPA;
34 private SisAtributoSatb sisAtributoSatb;
35 private UsuarioUsu usuarioUsu;
36
37 public ItemEstruturaSisAtributoIettSatb() {
38 }
39
40 public ItemEstruturaSisAtributoIettSatb(ItemEstruturaSisAtributoIettSatbPK comp_id) {
41 this.comp_id = comp_id;
42 }
43
44 public ItemEstruturaSisAtributoIettSatb(ItemEstruturaSisAtributoIettSatbPK comp_id, String informacaoIettSatb, Date dataUltManutencaoIettSatb, Boolean indExclusaoPosHistorico, ItemEstruturaIett itemEstruturaIett, ItemEstruturaIettPPA itemEstruturaIettPPA, SisAtributoSatb sisAtributoSatb, UsuarioUsu usuarioUsu) {
45 this.comp_id = comp_id;
46 this.informacaoIettSatb = informacaoIettSatb;
47 this.dataUltManutencaoIettSatb = dataUltManutencaoIettSatb;
48 this.indExclusaoPosHistorico = indExclusaoPosHistorico;
49 this.itemEstruturaIett = itemEstruturaIett;
50 this.itemEstruturaIettPPA = itemEstruturaIettPPA;
51 this.sisAtributoSatb = sisAtributoSatb;
52 this.usuarioUsu = usuarioUsu;
53 }
54
55 @EmbeddedId
56 @AttributeOverrides( { @AttributeOverride(name = "codIett", column = @Column(name = "COD_IETT", nullable = false, length = 10)), @AttributeOverride(name = "codSatb", column = @Column(name = "COD_SATB", nullable = false, length = 10)) })
57 public ItemEstruturaSisAtributoIettSatbPK getComp_id() {
58 return this.comp_id;
59 }
60
61 public void setComp_id(ItemEstruturaSisAtributoIettSatbPK comp_id) {
62 this.comp_id = comp_id;
63 }
64
65 @Column(name = "INFORMACAO", length = 2000)
66 public String getInformacaoIettSatb() {
67 return this.informacaoIettSatb;
68 }
69
70 public void setInformacaoIettSatb(String informacaoIettSatb) {
71 this.informacaoIettSatb = informacaoIettSatb;
72 }
73
74 @Column(name = "DATA_ULT_MANUTENCAO")
75 public Date getDataUltManutencaoIettSatb() {
76 return this.dataUltManutencaoIettSatb;
77 }
78
79 public void setDataUltManutencaoIettSatb(Date dataUltManutencaoIettSatb) {
80 this.dataUltManutencaoIettSatb = dataUltManutencaoIettSatb;
81 }
82
83 @Column(name = "IND_EXCLUSAO_POS_HISTORICO")
84 public Boolean getIndExclusaoPosHistorico() {
85 return this.indExclusaoPosHistorico;
86 }
87
88 public void setIndExclusaoPosHistorico(Boolean indExclusaoPosHistorico) {
89 this.indExclusaoPosHistorico = indExclusaoPosHistorico;
90 }
91
92 @ManyToOne(fetch = FetchType.LAZY)
93 @JoinColumn(name = "cod_iett", insertable = false, updatable = false)
94 public ItemEstruturaIett getItemEstruturaIett() {
95 return this.itemEstruturaIett;
96 }
97
98 public void setItemEstruturaIett(ItemEstruturaIett itemEstruturaIett) {
99 this.itemEstruturaIett = itemEstruturaIett;
100 }
101
102 @ManyToOne(fetch = FetchType.LAZY)
103 @JoinColumn(name = "cod_iett", insertable = false, updatable = false)
104 public ItemEstruturaIettPPA getItemEstruturaIettPPA() {
105 return this.itemEstruturaIettPPA;
106 }
107
108 public void setItemEstruturaIettPPA(ItemEstruturaIettPPA itemEstruturaIettPPA) {
109 this.itemEstruturaIettPPA = itemEstruturaIettPPA;
110 }
111
112 @ManyToOne(fetch = FetchType.LAZY)
113 @JoinColumn(name = "COD_SATB", insertable = false, updatable = false)
114 public SisAtributoSatb getSisAtributoSatb() {
115 return this.sisAtributoSatb;
116 }
117
118 public void setSisAtributoSatb(SisAtributoSatb sisAtributoSatb) {
119 this.sisAtributoSatb = sisAtributoSatb;
120 }
121
122 @ManyToOne(fetch = FetchType.LAZY)
123 @JoinColumn(name = "COD_USU_MANUTENCAO")
124 public UsuarioUsu getUsuarioUsu() {
125 return this.usuarioUsu;
126 }
127
128 public void setUsuarioUsu(UsuarioUsu usuarioUsu) {
129 this.usuarioUsu = usuarioUsu;
130 }
131
132 public void atribuirPKPai() {
133 comp_id = new ItemEstruturaSisAtributoIettSatbPK();
134 comp_id.setCodIett(this.getItemEstruturaIett().getCodIett());
135 comp_id.setCodSatb(this.getSisAtributoSatb().getCodSatb());
136 }
137
138 public String toString() {
139 return new ToStringBuilder(this).append("codIett", getComp_id().getCodIett()).append("codSatb", getComp_id().getCodSatb()).toString();
140 }
141
142 public boolean equals(Object other) {
143 if ((this == other))
144 return true;
145 if (!(other instanceof ItemEstruturaSisAtributoIettSatb))
146 return false;
147 ItemEstruturaSisAtributoIettSatb castOther = (ItemEstruturaSisAtributoIettSatb) other;
148 return new EqualsBuilder().append(this.getItemEstruturaIett().getCodIett(), castOther.getItemEstruturaIett().getCodIett()).append(this.getSisAtributoSatb().getCodSatb(), castOther.getSisAtributoSatb().getCodSatb()).isEquals();
149 }
150
151 }