1 package ecar.pojo;
2
3
4
5 import java.util.HashSet;
6 import java.util.Set;
7 import javax.persistence.Column;
8 import javax.persistence.Entity;
9 import javax.persistence.FetchType;
10 import javax.persistence.GeneratedValue;
11 import javax.persistence.Id;
12 import javax.persistence.OneToMany;
13 import javax.persistence.Table;
14 import org.hibernate.annotations.Cascade;
15 import org.hibernate.annotations.CascadeType;
16 import org.hibernate.annotations.GenericGenerator;
17
18
19
20
21 @Entity
22 @Table(name = "TB_TIPO_ENDERECO_TEND")
23 public class TipoEnderecoTend implements java.io.Serializable {
24
25 private Long codTpend;
26 private String descricaoTpend;
27 private Set<EnderecoEnd> enderecoEnds = new HashSet<EnderecoEnd>(0);
28
29 public TipoEnderecoTend() {
30 }
31
32 public TipoEnderecoTend(String descricaoTpend, Set<EnderecoEnd> enderecoEnds) {
33 this.descricaoTpend = descricaoTpend;
34 this.enderecoEnds = enderecoEnds;
35 }
36
37 @GenericGenerator(name = "generator", strategy = "increment")
38 @Id
39 @GeneratedValue(generator = "generator")
40 @Column(name = "COD_TPEND", nullable = false)
41 public Long getCodTpend() {
42 return this.codTpend;
43 }
44
45 public void setCodTpend(Long codTpend) {
46 this.codTpend = codTpend;
47 }
48
49 @Column(name = "DESCRICAO_TPEND", length = 2000)
50 public String getDescricaoTpend() {
51 return this.descricaoTpend;
52 }
53
54 public void setDescricaoTpend(String descricaoTpend) {
55 this.descricaoTpend = descricaoTpend;
56 }
57
58 @OneToMany(fetch = FetchType.LAZY, mappedBy = "tipoEnderecoTend")
59 @Cascade( { CascadeType.SAVE_UPDATE })
60 public Set<EnderecoEnd> getEnderecoEnds() {
61 return this.enderecoEnds;
62 }
63
64 public void setEnderecoEnds(Set<EnderecoEnd> enderecoEnds) {
65 this.enderecoEnds = enderecoEnds;
66 }
67
68 }