-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRole.java
More file actions
45 lines (36 loc) · 832 Bytes
/
Role.java
File metadata and controls
45 lines (36 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.example.demo;
import javax.persistence.*;
import java.util.Collection;
@Entity
public class Role {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Column(unique=true)
private String role;
@ManyToMany(mappedBy = "roles", fetch = FetchType.LAZY)
private Collection<User> users;
public Role() {
}
public Role(String role) {
this.role = role;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public Collection<User> getUsers() {
return users;
}
public void setUsers(Collection<User> users) {
this.users = users;
}
}