com.j2biz.blogunity.dao
Class UserDAO

java.lang.Object
  extended bycom.j2biz.blogunity.dao.AbstractDAO
      extended bycom.j2biz.blogunity.dao.UserDAO

public class UserDAO
extends AbstractDAO

Since:
0.1
Author:
michelson

Field Summary
 
Fields inherited from class com.j2biz.blogunity.dao.AbstractDAO
eventService
 
Constructor Summary
UserDAO()
           
 
Method Summary
 void attachToSession(User user)
          Refreshes user-instance saved within Hibernate-Session.
 Serializable createUser(User user)
          Persists given user-instance into database.
 void deleteUser(User user)
          Deletes database-entry equals to the given user-instance from database.
 List getAllUsers()
          Returns a list of all persistent user-objects.
 List getFriendOfList(User u)
          Returns list of the users, one of whose friends is the given user.
 List getLastRegisteredUsers(int count)
          Returns #count - users ordered by registration date.
 User getUserByID(long id)
          Returns user-instance with the given ID.
 User getUserByID(Long id)
          Returns user-instance with the given ID.
 User getUserByName(String nickname)
          Returns user-instance with the given nickname.
 User getUserByNameAndPassword(String nickname, String password)
          Returns user-instance with the given nickname and password.
 List getUsersWithNicknameLike(String likeNickname)
          Returns list of the users, whose nickname is like the given one (similar to sql's LIKE).
 void updateUser(User user)
          Updates database-entry equals to the given user-instance.
 
Methods inherited from class com.j2biz.blogunity.dao.AbstractDAO
create, delete, getByID, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserDAO

public UserDAO()
Method Detail

getUserByID

public User getUserByID(long id)
                 throws BlogunityException
Returns user-instance with the given ID.

Parameters:
id -
Returns:
Throws:
BlogException
BlogunityException

getUserByID

public User getUserByID(Long id)
                 throws BlogunityException
Returns user-instance with the given ID.

Parameters:
id -
Returns:
Throws:
BlogException
BlogunityException

getUserByNameAndPassword

public User getUserByNameAndPassword(String nickname,
                                     String password)
                              throws BlogunityException
Returns user-instance with the given nickname and password.

Parameters:
nickname -
password -
Returns:
Throws:
BlogException
BlogunityException

getUserByName

public User getUserByName(String nickname)
                   throws BlogunityException
Returns user-instance with the given nickname.

Parameters:
nickname -
Returns:
Throws:
BlogException
BlogunityException

createUser

public Serializable createUser(User user)
                        throws BlogunityException
Persists given user-instance into database.

Parameters:
user -
Returns:
Throws:
BlogException
BlogunityException

deleteUser

public void deleteUser(User user)
                throws BlogunityException
Deletes database-entry equals to the given user-instance from database.

Parameters:
user -
Throws:
BlogException
BlogunityException

updateUser

public void updateUser(User user)
                throws BlogunityException
Updates database-entry equals to the given user-instance.

Parameters:
user -
Throws:
BlogException
BlogunityException

attachToSession

public void attachToSession(User user)
                     throws BlogunityException
Refreshes user-instance saved within Hibernate-Session.

Parameters:
user -
Throws:
BlogException
BlogunityException

getLastRegisteredUsers

public List getLastRegisteredUsers(int count)
                            throws BlogunityException
Returns #count - users ordered by registration date.

Parameters:
count -
Returns:
Throws:
BlogException
BlogunityException

getAllUsers

public List getAllUsers()
                 throws BlogunityException
Returns a list of all persistent user-objects.

Returns:
Throws:
BlogunityException

getFriendOfList

public List getFriendOfList(User u)
                     throws BlogunityException
Returns list of the users, one of whose friends is the given user.

Parameters:
u -
Returns:
Throws:
BlogException
BlogunityException

getUsersWithNicknameLike

public List getUsersWithNicknameLike(String likeNickname)
                              throws BlogunityException
Returns list of the users, whose nickname is like the given one (similar to sql's LIKE).

Parameters:
likeNickname -
Returns:
list of the users.
Throws:
BlogException
BlogunityException


Copyright (c)j2biz.com