com.github.iintelligas.persist.entity.PermissionEntity Maven / Gradle / Ivy
The newest version!
package com.github.iintelligas.persist.entity;
import org.springframework.security.core.GrantedAuthority;
import javax.persistence.*;
@Entity
@Table(name = "permission")
public class PermissionEntity implements GrantedAuthority {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
private String description;
public PermissionEntity() {
}
public PermissionEntity(String name) {
this.name = name;
}
public PermissionEntity(String name, String description) {
this.name = name;
this.description = description;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public String getAuthority() {
return getName();
}
@Override
public String toString() {
return "PermissionEntity{" +
"id=" + id +
", name='" + name + '\'' +
", description='" + description + '\'' +
'}';
}
}