All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.utfpr.porta.modelo.TokenResetSenhaId Maven / Gradle / Ivy

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