1 package de.tivsource.page.entity.administration;
2
3 import java.security.Principal;
4 import java.util.Date;
5 import java.util.List;
6
7 import javax.persistence.CascadeType;
8 import javax.persistence.Column;
9 import javax.persistence.Entity;
10 import javax.persistence.FetchType;
11 import javax.persistence.Id;
12 import javax.persistence.ManyToMany;
13 import javax.persistence.Temporal;
14
15 import org.hibernate.envers.Audited;
16 import org.hibernate.search.annotations.DocumentId;
17
18
19
20
21
22
23
24 @Audited
25 @Entity
26 public class Role implements Principal {
27
28
29
30
31
32 @Id
33 @DocumentId
34 @Column(name="uuid", unique=true, length=42)
35 private String uuid;
36
37
38
39
40 private String technical;
41
42
43
44
45 @ManyToMany(
46 cascade = { CascadeType.PERSIST },
47 fetch = FetchType.EAGER,
48 mappedBy = "roles",
49 targetEntity = User.class
50 )
51 private List<User> users;
52
53
54
55
56
57 @Temporal(javax.persistence.TemporalType.TIMESTAMP)
58 private Date created;
59
60
61
62
63 @Temporal(javax.persistence.TemporalType.TIMESTAMP)
64 private Date modified;
65
66
67
68
69
70 private String modifiedBy;
71
72
73
74
75 private String modifiedAddress;
76
77 public String getUuid() {
78 return uuid;
79 }
80
81 public void setUuid(String uuid) {
82 this.uuid = uuid;
83 }
84
85 public String getTechnical() {
86 return technical;
87 }
88
89 public void setTechnical(String technical) {
90 this.technical = technical;
91 }
92
93 public List<User> getUsers() {
94 return users;
95 }
96
97 public void setUsers(List<User> users) {
98 this.users = users;
99 }
100
101 public Date getCreated() {
102 return created;
103 }
104
105 public void setCreated(Date created) {
106 this.created = created;
107 }
108
109 public Date getModified() {
110 return modified;
111 }
112
113 public void setModified(Date modified) {
114 this.modified = modified;
115 }
116
117 public String getModifiedBy() {
118 return modifiedBy;
119 }
120
121 public void setModifiedBy(String modifiedBy) {
122 this.modifiedBy = modifiedBy;
123 }
124
125 public String getModifiedAddress() {
126 return modifiedAddress;
127 }
128
129 public void setModifiedAddress(String modifiedAddress) {
130 this.modifiedAddress = modifiedAddress;
131 }
132
133 @Override
134 public String getName() {
135 return this.technical;
136 }
137
138 }