Commit f98d1df5d034f6c130bbb277ea085977e0fdc913
1 parent
44c7c823
Exists in
master
Mapeamento da tabela "TipoUnidade"
Showing
1 changed file
with
54 additions
and
0 deletions
Show diff stats
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/model/TipoUnidade.java
0 → 100644
@@ -0,0 +1,54 @@ | @@ -0,0 +1,54 @@ | ||
1 | +package br.com.eselo.model; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import javax.persistence.CascadeType; | ||
6 | +import javax.persistence.Column; | ||
7 | +import javax.persistence.Entity; | ||
8 | +import javax.persistence.FetchType; | ||
9 | +import javax.persistence.GeneratedValue; | ||
10 | +import javax.persistence.Id; | ||
11 | +import javax.persistence.OneToMany; | ||
12 | +import javax.persistence.Table; | ||
13 | + | ||
14 | +@Entity | ||
15 | +@Table(name = "sel_tipo_unidade") | ||
16 | +public class TipoUnidade { | ||
17 | + | ||
18 | + @Id | ||
19 | + @GeneratedValue | ||
20 | + @Column(name = "id_tipo_unidade", columnDefinition = "serial", unique = true, nullable = false) | ||
21 | + private Long id; | ||
22 | + | ||
23 | + @Column(name = "ds_tipo_unidade", nullable = false) | ||
24 | + private String dsTipoUnidade; | ||
25 | + | ||
26 | + @OneToMany(mappedBy = "tipoUnidade", targetEntity = br.com.eselo.model.Orgao.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) | ||
27 | + private List<Orgao> orgaos; | ||
28 | + | ||
29 | + public Long getId() { | ||
30 | + return id; | ||
31 | + } | ||
32 | + | ||
33 | + public void setId(Long id) { | ||
34 | + this.id = id; | ||
35 | + } | ||
36 | + | ||
37 | + public String getDsTipoUnidade() { | ||
38 | + return dsTipoUnidade; | ||
39 | + } | ||
40 | + | ||
41 | + public void setDsTipoUnidade(String dsTipoUnidade) { | ||
42 | + this.dsTipoUnidade = dsTipoUnidade; | ||
43 | + } | ||
44 | + | ||
45 | + public List<Orgao> getOrgaos() { | ||
46 | + return orgaos; | ||
47 | + } | ||
48 | + | ||
49 | + public void setOrgaos(List<Orgao> orgaos) { | ||
50 | + this.orgaos = orgaos; | ||
51 | + } | ||
52 | + | ||
53 | + | ||
54 | +} |