1
2
3
4
5 package org.directdemocracyportal.democracy.model.application;
6
7 import javax.persistence.Entity;
8 import javax.persistence.GeneratedValue;
9 import javax.persistence.GenerationType;
10 import javax.persistence.Id;
11
12 import org.directdemocracyportal.democracy.model.core.BaseEntity;
13 import org.hibernate.annotations.Cache;
14 import org.hibernate.annotations.CacheConcurrencyStrategy;
15
16 /***
17 * The Class Authority.
18 */
19 @Entity
20 @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
21 public class Authority extends BaseEntity
22 {
23
24 /*** The Constant serialVersionUID. */
25 private static final long serialVersionUID = 5016030282926576514L;
26
27 /*** The id. */
28 private Long id;
29
30 /*** The user role. */
31 private SecurityRoleType userRole;
32
33 /***
34 * Instantiates a new authority.
35 */
36 public Authority() {
37 }
38
39 /***
40 * Instantiates a new authority.
41 *
42 * @param userRole the user role
43 */
44 public Authority(SecurityRoleType userRole) {
45 this.userRole = userRole;
46 }
47
48
49
50
51
52
53 @Override
54 @Id
55 @GeneratedValue(strategy = GenerationType.AUTO)
56 public Long getId() {
57 return this.id;
58 }
59
60 /***
61 * Sets the id.
62 *
63 * @param id the new id
64 */
65 public void setId(Long id) {
66 this.id = id;
67 }
68
69 /***
70 * Gets the user role.
71 *
72 * @return the user role
73 */
74 public SecurityRoleType getUserRole() {
75 return userRole;
76 }
77
78 /***
79 * Sets the user role.
80 *
81 * @param userRole the new user role
82 */
83 public void setUserRole(SecurityRoleType userRole) {
84 this.userRole = userRole;
85 }
86 }