br.com.utfpr.porta.modelo.TokenResetSenhaId Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tcc-porta-servico Show documentation
Show all versions of tcc-porta-servico Show documentation
Projeto serviço que realiza acesso ao banco de dados para o projeto API e web
The newest version!
package br.com.utfpr.porta.modelo;
import java.io.Serializable;
import javax.persistence.Embeddable;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.validation.constraints.NotNull;
@Embeddable
public class TokenResetSenhaId implements Serializable{
private static final long serialVersionUID = 1L;
@NotNull(message = "Usuário não pode ser nulo")
@OneToOne
@JoinColumn(name = "codigo_usuario")
private Usuario usuario;
public TokenResetSenhaId(){}
public TokenResetSenhaId(Usuario usuario) {
this.usuario = usuario;
}
public Usuario getUsuario() {
return usuario;
}
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((usuario == null) ? 0 : usuario.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
TokenResetSenhaId other = (TokenResetSenhaId) obj;
if (usuario == null) {
if (other.usuario != null)
return false;
} else if (!usuario.equals(other.usuario))
return false;
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy