org.bejug.javacareers.jobs.dao
Interface UserDao

All Known Implementing Classes:
UserDaoHibernateImpl

public interface UserDao

The User Data Access Object interface.

Version:
$Revision: 1.2 $ - $Date: 2005/09/13 08:11:17 $
Author:
Sven Schauwvliege (Last modified by $Author: schauwvliege $)

Method Summary
 void deleteUser(java.lang.Integer id)
          Delete an User by id.
 void deleteUser(org.bejug.javacareers.jobs.model.User user)
          Delete an User by id.
 org.bejug.javacareers.jobs.model.User getUser(java.lang.Integer id)
          Gets an User by id.
 org.bejug.javacareers.jobs.model.User getUserByUserName(java.lang.String userName)
          Gets an User by username.
 java.util.List getUsers()
          Lists all users.
 void store(org.bejug.javacareers.jobs.model.User user)
          Adds and updates an user type to the database.
 

Method Detail

getUsers

public java.util.List getUsers()
                        throws org.springframework.dao.DataAccessException
Lists all users.

Returns:
a List containing all users
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong

store

public void store(org.bejug.javacareers.jobs.model.User user)
           throws org.springframework.dao.DataAccessException,
                  org.bejug.javacareers.common.exception.DuplicateUserNameException,
                  org.bejug.javacareers.common.exception.LastAdminException
Adds and updates an user type to the database.

Parameters:
user - the User to add
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong when adding an user
org.bejug.javacareers.common.exception.DuplicateUserNameException - thrown when username is already in use
org.bejug.javacareers.common.exception.LastAdminException - thrown when trying to delete the last admin.

getUser

public org.bejug.javacareers.jobs.model.User getUser(java.lang.Integer id)
                                              throws org.springframework.dao.DataAccessException
Gets an User by id.

Parameters:
id - the id of the User
Returns:
the wanted User or null if not found
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong when getting an User

deleteUser

public void deleteUser(org.bejug.javacareers.jobs.model.User user)
                throws org.springframework.dao.DataAccessException,
                       org.bejug.javacareers.common.exception.LastAdminException
Delete an User by id.

Parameters:
user - The user.
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong
org.bejug.javacareers.common.exception.LastAdminException - if someone deletes the last username.

deleteUser

public void deleteUser(java.lang.Integer id)
                throws org.springframework.dao.DataAccessException,
                       org.bejug.javacareers.common.exception.LastAdminException
Delete an User by id.

Parameters:
id - The user identifier.
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong
org.bejug.javacareers.common.exception.LastAdminException - if someone deletes the last username.

getUserByUserName

public org.bejug.javacareers.jobs.model.User getUserByUserName(java.lang.String userName)
                                                        throws org.springframework.dao.DataAccessException
Gets an User by username.

Parameters:
userName - of the User
Returns:
the wanted User or null if not found
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong when getting an User


Copyright © 2005-2006 BeJUG. All Rights Reserved.