8b09d1f574f8896c40954c3012d28d27a9739a3c
[vid.git] / vid-ext-services-simulator / src / main / java / org / onap / simulator / db / entities / Role.java
1 package org.onap.simulator.db.entities;
2
3 import java.util.Set;
4 import javax.persistence.CascadeType;
5 import javax.persistence.Column;
6 import javax.persistence.Entity;
7 import javax.persistence.Id;
8 import javax.persistence.OneToMany;
9 import org.hibernate.annotations.Type;
10
11 @Entity(name = "fn_role")
12 public class Role {
13     @Id
14     @Column(name = "role_id")
15     private Integer id;
16     @Column(name = "role_name")
17     private String name;
18     @Column(name = "active_yn", columnDefinition = "varchar")
19     @Type(type="yes_no")
20     private boolean active;
21
22     @OneToMany(cascade = CascadeType.ALL, targetEntity=RoleFunction.class, mappedBy="id")
23     private Set<RoleFunction> roleFunctions;
24
25     public Integer getId() {
26         return id;
27     }
28
29     public void setId(Integer id) {
30         this.id = id;
31     }
32
33     public String getName() {
34         return name;
35     }
36
37     public void setName(String name) {
38         this.name = name;
39     }
40
41     public boolean isActive() {
42         return active;
43     }
44
45     public void setActive(boolean active) {
46         this.active = active;
47     }
48
49
50     public Set<RoleFunction> getRoleFunctions() {
51         return roleFunctions;
52     }
53
54     public void setRoleFunctions(Set<RoleFunction> roleFunctions) {
55         this.roleFunctions = roleFunctions;
56     }
57 }