Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package br.ufc.mandacaru5.model;
- import java.util.Collection;
- import java.util.List;
- import javax.persistence.Column;
- import javax.persistence.Entity;
- import javax.persistence.GeneratedValue;
- import javax.persistence.GenerationType;
- import javax.persistence.Id;
- import javax.persistence.JoinColumn;
- import javax.persistence.JoinTable;
- import javax.persistence.ManyToMany;
- import javax.persistence.SequenceGenerator;
- import org.springframework.security.core.GrantedAuthority;
- import org.springframework.security.core.userdetails.UserDetails;
- @Entity
- public class Login implements UserDetails {
- @Id
- @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "login_generator")
- @SequenceGenerator(name="login_generator", sequenceName = "login_seq", allocationSize=1)
- private int id;
- @Column(nullable = false, unique = true)
- private String email;
- @Column(nullable = false)
- private String password;
- @Override
- public Collection<? extends GrantedAuthority> getAuthorities() {
- // TODO Auto-generated method stub
- return null;
- }
- @Override
- public String getPassword() {
- // TODO Auto-generated method stub
- return password;
- }
- @Override
- public String getUsername() {
- // TODO Auto-generated method stub
- return email;
- }
- @Override
- public boolean isAccountNonExpired() {
- // TODO Auto-generated method stub
- return true;
- }
- @Override
- public boolean isAccountNonLocked() {
- // TODO Auto-generated method stub
- return true;
- }
- @Override
- public boolean isCredentialsNonExpired() {
- // TODO Auto-generated method stub
- return true;
- }
- @Override
- public boolean isEnabled() {
- // TODO Auto-generated method stub
- return true;
- }
- @Override
- public String toString() {
- return "Login [id=" + id + ", email=" + email + ", password=" + password + "]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement