org.itracker.persistence.dao
Class UserDAOImpl

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.itracker.persistence.dao.BaseHibernateDAOImpl<User>
              extended by org.itracker.persistence.dao.UserDAOImpl
All Implemented Interfaces:
BaseDAO<User>, UserDAO, org.springframework.beans.factory.InitializingBean

public class UserDAOImpl
extends BaseHibernateDAOImpl<User>
implements UserDAO


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
UserDAOImpl()
           
 
Method Summary
 List<User> findActive()
          Finds all active users.
 List<User> findAll()
          Finds all users.
 User findByLogin(String login)
          Finds a user by login.
 User findByPrimaryKey(Integer userId)
          Finds the users with the given primary key.
 List<User> findByRegistrationType(int registrationType)
          Finds users with the given registration type.
 List<User> findByStatus(int status)
          Finds users with the given status.
 List<User> findSuperUsers()
          Finds all super users.
 List<User> findUsersForProjectByAllPermissionTypeList(Integer projectID, Integer[] permissionTypes)
           
 Map<Integer,Set<PermissionType>> getUsersMapOfProjectsAndPermissionTypes(User user)
          Searches all permissions for the given user and sorts it by project.
 
Methods inherited from class org.itracker.persistence.dao.BaseHibernateDAOImpl
delete, detach, merge, refresh, save, saveOrUpdate
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.itracker.persistence.dao.BaseDAO
delete, detach, merge, refresh, save, saveOrUpdate
 

Constructor Detail

UserDAOImpl

public UserDAOImpl()
Method Detail

findByPrimaryKey

public User findByPrimaryKey(Integer userId)
Description copied from interface: UserDAO
Finds the users with the given primary key. PENDING: should this method throw a NoSuchEntityException instead of returning null if the userId doesn't exist ?

Specified by:
findByPrimaryKey in interface UserDAO
Parameters:
userId - ID of the user to retrieve
Returns:
user with the given ID or null if none exits

findByLogin

public User findByLogin(String login)
Description copied from interface: UserDAO
Finds a user by login.

Specified by:
findByLogin in interface UserDAO
Parameters:
login - login name of the user to find
Returns:
user with the given login or null if login is unknown

findAll

public List<User> findAll()
Description copied from interface: UserDAO
Finds all users.

Specified by:
findAll in interface UserDAO
Returns:
list of all users, in unspecified order

findActive

public List<User> findActive()
Description copied from interface: UserDAO
Finds all active users.

Specified by:
findActive in interface UserDAO
Returns:
list of users with a status > 0, in unspecified order

findByStatus

public List<User> findByStatus(int status)
Description copied from interface: UserDAO
Finds users with the given status.

Specified by:
findByStatus in interface UserDAO
Parameters:
status - status code
Returns:
list of users with the given status, in unspecified order

findSuperUsers

public List<User> findSuperUsers()
Description copied from interface: UserDAO
Finds all super users.

Specified by:
findSuperUsers in interface UserDAO
Returns:
list of super users, in unspecified order

findByRegistrationType

public List<User> findByRegistrationType(int registrationType)
Description copied from interface: UserDAO
Finds users with the given registration type.

Specified by:
findByRegistrationType in interface UserDAO
Returns:
list of users with the given registration type, in unspecified order

getUsersMapOfProjectsAndPermissionTypes

public Map<Integer,Set<PermissionType>> getUsersMapOfProjectsAndPermissionTypes(User user)
Searches all permissions for the given user and sorts it by project. The HashMap returned has the project ids as key (Integer) and a HashSet as values. The HashSet holds a set of string representation of the permission

Specified by:
getUsersMapOfProjectsAndPermissionTypes in interface UserDAO
Parameters:
user - The user of interest
requestSource - requested by
Returns:
HashMap of permission keyed by project ids

findUsersForProjectByAllPermissionTypeList

public List<User> findUsersForProjectByAllPermissionTypeList(Integer projectID,
                                                             Integer[] permissionTypes)
Specified by:
findUsersForProjectByAllPermissionTypeList in interface UserDAO


Copyright © 2002-2012 itracker. All Rights Reserved.