Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package br.ufc.mandacaru5.model;
- import javax.persistence.Column;
- import javax.persistence.Entity;
- import javax.persistence.GeneratedValue;
- import javax.persistence.GenerationType;
- import javax.persistence.Id;
- import javax.persistence.SequenceGenerator;
- import org.springframework.security.core.GrantedAuthority;
- @Entity
- public class Role implements GrantedAuthority {
- @Id
- @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "role_generator")
- @SequenceGenerator(name="role_generator", sequenceName = "role_seq", allocationSize=1)
- private int id;
- @Column(nullable = false, unique = true)
- private String name;
- @Override
- public String getAuthority() {
- return name;
- }
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- @Override
- public String toString() {
- return "Role [id=" + id + ", name=" + name + "]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement