1 package ecar.pojo;
2
3
4
5 import java.util.Date;
6 import java.util.HashSet;
7 import java.util.Set;
8 import javax.persistence.Column;
9 import javax.persistence.Entity;
10 import javax.persistence.FetchType;
11 import javax.persistence.GeneratedValue;
12 import javax.persistence.Id;
13 import javax.persistence.OneToMany;
14 import javax.persistence.Table;
15 import javax.persistence.Temporal;
16 import javax.persistence.TemporalType;
17 import org.hibernate.annotations.GenericGenerator;
18
19
20
21
22 @Entity
23 @Table(name = "TB_SEGMENTO_AREA_SGTA")
24 public class SegmentoAreaSgta implements java.io.Serializable {
25
26 private Long codSgta;
27 private Date dataInclusaoSgta;
28 private String descricaoSgta;
29 private Set<SegmentoSgt> segmentoSgts = new HashSet<SegmentoSgt>(0);
30
31 public SegmentoAreaSgta() {
32 }
33
34 public SegmentoAreaSgta(Date dataInclusaoSgta, String descricaoSgta, Set<SegmentoSgt> segmentoSgts) {
35 this.dataInclusaoSgta = dataInclusaoSgta;
36 this.descricaoSgta = descricaoSgta;
37 this.segmentoSgts = segmentoSgts;
38 }
39
40 @GenericGenerator(name = "generator", strategy = "increment")
41 @Id
42 @GeneratedValue(generator = "generator")
43 @Column(name = "COD_SGTA", nullable = false)
44 public Long getCodSgta() {
45 return this.codSgta;
46 }
47
48 public void setCodSgta(Long codSgta) {
49 this.codSgta = codSgta;
50 }
51
52 @Temporal(TemporalType.TIMESTAMP)
53 @Column(name = "DATA_INCLUSAO_SGTA", length = 7)
54 public Date getDataInclusaoSgta() {
55 return this.dataInclusaoSgta;
56 }
57
58 public void setDataInclusaoSgta(Date dataInclusaoSgta) {
59 this.dataInclusaoSgta = dataInclusaoSgta;
60 }
61
62 @Column(name = "DESCRICAO_SGTA", length = 40)
63 public String getDescricaoSgta() {
64 return this.descricaoSgta;
65 }
66
67 public void setDescricaoSgta(String descricaoSgta) {
68 this.descricaoSgta = descricaoSgta;
69 }
70
71 @OneToMany(fetch = FetchType.LAZY, mappedBy = "segmentoAreaSgta")
72 public Set<SegmentoSgt> getSegmentoSgts() {
73 return this.segmentoSgts;
74 }
75
76 public void setSegmentoSgts(Set<SegmentoSgt> segmentoSgts) {
77 this.segmentoSgts = segmentoSgts;
78 }
79
80 }