Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.30 KB | None | 0 0
  1. @Entity(name = "User")
  2. @Table(name = "usuario")
  3. public class User implements Serializable
  4. {
  5.     /**
  6.      *
  7.      */
  8.     private static final long serialVersionUID = -6376218806504443050L;
  9.    
  10.     private Long id;
  11.     private String username;
  12.     private String password;
  13.     private String screenname;
  14.     private Set<Role> roles;
  15.     private Boolean enabled;
  16.  
  17.     @Id @GeneratedValue
  18.     public Long getId() {
  19.         return id;
  20.     }
  21.  
  22.     public void setId(Long id) {
  23.         this.id = id;
  24.     }
  25.  
  26.     @UserPrincipal
  27.     public String getUsername() {
  28.         return username;
  29.     }
  30.  
  31.     public void setUsername(String username) {
  32.         this.username = username;
  33.     }
  34.  
  35.     @UserPassword(hash = "md5")
  36.     public String getPassword() {
  37.         return password;
  38.     }
  39.  
  40.     public void setPassword(String password) {
  41.         this.password = password;
  42.     }
  43.  
  44.     @UserFirstName
  45.     public String getScreenname() {
  46.         return screenname;
  47.     }
  48.  
  49.     public void setScreenname(String screenname) {
  50.         this.screenname = screenname;
  51.     }
  52.  
  53.     @UserRoles
  54.     @ManyToMany(targetEntity = Role.class)
  55.     public Set<Role> getRoles() {
  56.         return roles;
  57.     }
  58.    
  59.     public void setRoles(Set<Role> roles) {
  60.         this.roles = roles;
  61.     }
  62.  
  63.     @UserEnabled
  64.     public Boolean getEnabled() {
  65.         return enabled;
  66.     }
  67.    
  68.     public void setEnabled(Boolean enabled) {
  69.         this.enabled = enabled;
  70.     }
  71.  
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement