Advertisement
andersonalmada2

Untitled

Aug 5th, 2022
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.83 KB | None | 0 0
  1. package br.ufc.mandacaru5.model;
  2.  
  3. import java.util.Collection;
  4. import java.util.List;
  5.  
  6. import javax.persistence.Column;
  7. import javax.persistence.Entity;
  8. import javax.persistence.GeneratedValue;
  9. import javax.persistence.GenerationType;
  10. import javax.persistence.Id;
  11. import javax.persistence.JoinColumn;
  12. import javax.persistence.JoinTable;
  13. import javax.persistence.ManyToMany;
  14. import javax.persistence.SequenceGenerator;
  15.  
  16. import org.springframework.security.core.GrantedAuthority;
  17. import org.springframework.security.core.userdetails.UserDetails;
  18.  
  19. @Entity
  20. public class Login implements UserDetails {
  21.  
  22.     @Id
  23.     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "login_generator")
  24.     @SequenceGenerator(name="login_generator", sequenceName = "login_seq", allocationSize=1)
  25.     private int id;
  26.     @Column(nullable = false, unique = true)
  27.     private String email;
  28.     @Column(nullable = false)
  29.     private String password;
  30.  
  31.     @Override
  32.     public Collection<? extends GrantedAuthority> getAuthorities() {
  33.         // TODO Auto-generated method stub
  34.         return null;
  35.     }
  36.  
  37.     @Override
  38.     public String getPassword() {
  39.         // TODO Auto-generated method stub
  40.         return password;
  41.     }
  42.  
  43.     @Override
  44.     public String getUsername() {
  45.         // TODO Auto-generated method stub
  46.         return email;
  47.     }
  48.  
  49.     @Override
  50.     public boolean isAccountNonExpired() {
  51.         // TODO Auto-generated method stub
  52.         return true;
  53.     }
  54.  
  55.     @Override
  56.     public boolean isAccountNonLocked() {
  57.         // TODO Auto-generated method stub
  58.         return true;
  59.     }
  60.  
  61.     @Override
  62.     public boolean isCredentialsNonExpired() {
  63.         // TODO Auto-generated method stub
  64.         return true;
  65.     }
  66.  
  67.     @Override
  68.     public boolean isEnabled() {
  69.         // TODO Auto-generated method stub
  70.         return true;
  71.     }
  72.  
  73.     @Override
  74.     public String toString() {
  75.         return "Login [id=" + id + ", email=" + email + ", password=" + password + "]";
  76.     }
  77.    
  78.    
  79. }
  80.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement