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

br.com.jhonsapp.finaluser.persistence.UserDAO Maven / Gradle / Ivy

package br.com.jhonsapp.finaluser.persistence;

import java.util.List;

import javax.ejb.Local;

import br.com.jhonsapp.bootstrap.object.persistence.generic.GenericDAO;
import br.com.jhonsapp.finaluser.domain.User;

/**
 * EJB service that defines the User data access object. This service was
 * designed to be used in login implementations.
 * 
 * @see User
 * 
 * @author Jhonathan Camacho
 *
 */
@Local
public interface UserDAO extends GenericDAO{

	/**
	 * Find all persisted user.
	 * 
	 * @return a list with all user persisted in the database.
	 */
	public List findAll();

	/**
	 * Find a persisted user by his e-mail.
	 * 
	 * @param email
	 *            the user's e-mail
	 * @return the User that have the e-mail passed by parameter or null
	 *         otherwise.
	 */
	public T findByEmail(String email);

	public boolean canLogin(String email, String password);

	/**
	 * Find all persisted users based on a id range.
	 * 
	 * @param first
	 *            the initial user id of the query range.
	 * @param last
	 *            the last user id of the query range.
	 * @return a list with the users that satisfy the range or a empty list
	 *         otherwise.
	 */
	public List findAllInARange(int first, int last);

	public Long usersSize();
	
	/**
	 * Find a persisted user by his restToken.
	 * 
	 * @param accessToken
	 *            the user's accessToken
	 * @return the User that have the accessToken passed by parameter or null
	 *         otherwise.
	 */
	public T findByAccessToken(String accessToken);
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy