1 |
|
package io.sunshower.model.core.auth; |
2 |
|
|
3 |
|
import io.sunshower.model.core.Schemata; |
4 |
|
import io.sunshower.persistence.core.DistributableEntity; |
5 |
|
import java.util.LinkedHashSet; |
6 |
|
import java.util.Set; |
7 |
|
import javax.persistence.*; |
8 |
|
import javax.xml.bind.annotation.XmlRootElement; |
9 |
|
|
10 |
|
@Entity |
11 |
|
@XmlRootElement |
12 |
|
@Table(name = "PERMISSION", schema = Schemata.SUNSHOWER) |
|
|
| 75% |
Uncovered Elements: 3 (12) |
Complexity: 5 |
Complexity Density: 0.83 |
|
13 |
|
public class Permission extends DistributableEntity { |
14 |
|
|
15 |
|
@Basic @Column private String name; |
16 |
|
|
17 |
|
@Basic private String description; |
18 |
|
|
19 |
|
@ManyToMany(mappedBy = "permissions") |
20 |
|
private Set<Role> roles; |
21 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
22 |
1 |
public Permission() {... |
23 |
1 |
super(); |
24 |
|
} |
25 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
26 |
1 |
public Permission(final String name) {... |
27 |
1 |
this(); |
28 |
|
} |
29 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
30 |
1 |
public void addRole(Role role) {... |
31 |
1 |
if (this.roles == null) { |
32 |
1 |
this.roles = new LinkedHashSet<>(); |
33 |
|
} |
34 |
1 |
this.roles.add(role); |
35 |
|
} |
36 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
37 |
0 |
@Override... |
38 |
|
public String toString() { |
39 |
0 |
return "Permission{" + "name='" + name + '\'' + ", description='" + description + '\'' + '}'; |
40 |
|
} |
41 |
|
} |