br.com.arsmachina.authentication.dao
Interface UserDAO

All Superinterfaces:
br.com.arsmachina.dao.DAO<User,Integer>, br.com.arsmachina.dao.ReadableDAO<User,Integer>, br.com.arsmachina.dao.WriteableDAO<User,Integer>

public interface UserDAO
extends br.com.arsmachina.dao.DAO<User,Integer>

Data access object (DAO) for User.

Author:
Thiago H. de Paula Figueiredo

Method Summary
 User findByLogin(String login)
          Returns the user with a given login or null if no such user exists.
 User findByLoginAndPassword(String login, String password)
          Returns the user with a given login and password or null if no such user exists.
<T extends Role>
List<User>
findByRole(Class<T> roleClass)
          Returns all users with a given Role subclass.
 boolean hasUserWithLogin(String login)
          Tells if some user with a given login exists.
 
Methods inherited from interface br.com.arsmachina.dao.ReadableDAO
countAll, findAll, findAll, findByExample, findById, findByIds, getDefaultSortCriteria, reattach, refresh
 
Methods inherited from interface br.com.arsmachina.dao.WriteableDAO
delete, delete, evict, isPersistent, save, update
 

Method Detail

findByLoginAndPassword

User findByLoginAndPassword(String login,
                            String password)
Returns the user with a given login and password or null if no such user exists.

Parameters:
login - a String.
password - a String.
Returns:
an User.

findByLogin

User findByLogin(String login)
Returns the user with a given login or null if no such user exists.

Parameters:
login - a String.
Returns:
an User.

findByRole

<T extends Role> List<User> findByRole(Class<T> roleClass)
Returns all users with a given Role subclass.

Parameters:
role - a Class. It must be a Role subclass and cannot be null.
Returns:
a List of Users.

hasUserWithLogin

boolean hasUserWithLogin(String login)
Tells if some user with a given login exists.

Parameters:
login - a String. It cannot be null.
Returns:
a boolean.


Copyright © 2008-2009 Thiago H. de Paula Figueiredo. All Rights Reserved.