1
2
3
4
5 package org.directdemocracyportal.democracy.model.application;
6
7 import java.util.HashSet;
8 import java.util.Set;
9
10 import javax.persistence.Entity;
11 import javax.persistence.FetchType;
12 import javax.persistence.ManyToMany;
13
14 import org.directdemocracyportal.democracy.model.core.Role;
15 import org.hibernate.annotations.Cache;
16 import org.hibernate.annotations.CacheConcurrencyStrategy;
17
18 /***
19 * The Class UserRole.
20 */
21 @Entity
22 @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
23 public class UserRole extends Role
24 {
25
26 /*** The Constant serialVersionUID. */
27 private static final long serialVersionUID = -1561947450119542687L;
28
29 /*** The role actions. */
30 private Set<RoleAction> roleActions = new HashSet<RoleAction>();
31
32 /***
33 * Instantiates a new user role.
34 */
35 public UserRole() {
36 }
37
38 /***
39 * Gets the role actions.
40 *
41 * @return the role actions
42 */
43 @ManyToMany(fetch = FetchType.LAZY)
44 public Set<RoleAction> getRoleActions() {
45 return this.roleActions;
46 }
47
48 /***
49 * Sets the role actions.
50 *
51 * @param roleActions the new role actions
52 */
53 public void setRoleActions(Set<RoleAction> roleActions) {
54 this.roleActions = roleActions;
55 }
56 }