mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
61 lines
1015 B
Java
61 lines
1015 B
Java
package com.avaje.tests.model.m2m;
|
|
|
|
import java.util.Set;
|
|
import java.util.UUID;
|
|
|
|
import javax.persistence.Column;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.ManyToMany;
|
|
import javax.persistence.Table;
|
|
|
|
import com.avaje.ebean.annotation.CacheStrategy;
|
|
|
|
/**
|
|
* The Class Permission.
|
|
*/
|
|
@Entity
|
|
@CacheStrategy(readOnly = true)
|
|
@Table(name = "mt_permission")
|
|
public class Permission {
|
|
|
|
@Id
|
|
private UUID id;
|
|
|
|
@Column
|
|
private String name;
|
|
|
|
@ManyToMany(mappedBy = "permissions")
|
|
private Set<Role> roles;
|
|
|
|
public UUID getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(UUID id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public Set<Role> getRoles() {
|
|
return roles;
|
|
}
|
|
|
|
public void setRoles(Set<Role> roles) {
|
|
this.roles = roles;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "name:" + name + "id:" + id;
|
|
}
|
|
|
|
}
|