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.JoinColumn;
13 import javax.persistence.JoinTable;
14 import javax.persistence.ManyToMany;
15 import javax.persistence.Table;
16 import org.hibernate.annotations.Cascade;
17 import org.hibernate.annotations.CascadeType;
18 import org.hibernate.annotations.GenericGenerator;
19
20
21
22
23 @Entity
24 @Table(name = "TB_PERFIL_PFL")
25 public class PerfilPfl implements java.io.Serializable {
26
27 private Long codPfl;
28 private String descricaoPfl;
29 private Integer nivelPfl;
30 private String indAreaReservadaPfl;
31 private Set<OpcaoOpc> opcaoPerfilOpcps = new HashSet<OpcaoOpc>(0);
32
33 public PerfilPfl() {
34 }
35
36 public PerfilPfl(String descricaoPfl, Integer nivelPfl, String indAreaReservadaPfl, Set<OpcaoOpc> opcaoPerfilOpcps) {
37 this.descricaoPfl = descricaoPfl;
38 this.nivelPfl = nivelPfl;
39 this.indAreaReservadaPfl = indAreaReservadaPfl;
40 this.opcaoPerfilOpcps = opcaoPerfilOpcps;
41 }
42
43 @GenericGenerator(name = "generator", strategy = "increment")
44 @Id
45 @GeneratedValue(generator = "generator")
46 @Column(name = "COD_PFL", nullable = false)
47 public Long getCodPfl() {
48 return this.codPfl;
49 }
50
51 public void setCodPfl(Long codPfl) {
52 this.codPfl = codPfl;
53 }
54
55 @Column(name = "DESCRICAO_PFL", length = 30)
56 public String getDescricaoPfl() {
57 return this.descricaoPfl;
58 }
59
60 public void setDescricaoPfl(String descricaoPfl) {
61 this.descricaoPfl = descricaoPfl;
62 }
63
64 @Column(name = "NIVEL_PFL", length = 2)
65 public Integer getNivelPfl() {
66 return this.nivelPfl;
67 }
68
69 public void setNivelPfl(Integer nivelPfl) {
70 this.nivelPfl = nivelPfl;
71 }
72
73 @Column(name = "IND_AREA_RESERVADA_PFL", length = 1)
74 public String getIndAreaReservadaPfl() {
75 return this.indAreaReservadaPfl;
76 }
77
78 public void setIndAreaReservadaPfl(String indAreaReservadaPfl) {
79 this.indAreaReservadaPfl = indAreaReservadaPfl;
80 }
81
82 @ManyToMany(fetch = FetchType.LAZY)
83 @JoinTable(name = "TB_OPCAO_PERFIL_OPCP", joinColumns = { @JoinColumn(name = "COD_PFL", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "COD_OPCAO", nullable = false, updatable = false) })
84 @Cascade( { CascadeType.SAVE_UPDATE })
85 public Set<OpcaoOpc> getOpcaoPerfilOpcps() {
86 return this.opcaoPerfilOpcps;
87 }
88
89 public void setOpcaoPerfilOpcps(Set<OpcaoOpc> opcaoPerfilOpcps) {
90 this.opcaoPerfilOpcps = opcaoPerfilOpcps;
91 }
92
93 }