org.openmrs.api.db
Interface UserDAO

All Known Implementing Classes:
HibernateUserDAO

public interface UserDAO

Database methods for the UserService

See Also:
Context, UserService

Method Summary
 void changeHashedPassword(User user, java.lang.String hashedPassword, java.lang.String salt)
           
 void changePassword(java.lang.String pw, java.lang.String pw2)
           
 void changePassword(User u, java.lang.String pw)
           
 void changeQuestionAnswer(java.lang.String pw, java.lang.String q, java.lang.String a)
           
 void changeQuestionAnswer(User u, java.lang.String question, java.lang.String answer)
           
 void deletePrivilege(Privilege privilege)
           
 void deleteRole(Role role)
           
 void deleteUser(User user)
           
 java.lang.Integer generateSystemId()
           
 java.util.List<Privilege> getAllPrivileges()
           
 java.util.List<Role> getAllRoles()
           
 java.util.List<User> getAllUsers()
           
 LoginCredential getLoginCredential(User user)
           
 LoginCredential getLoginCredentialByUuid(java.lang.String uuid)
          Auto generated method comment
 Privilege getPrivilege(java.lang.String p)
           
 Privilege getPrivilegeByUuid(java.lang.String uuid)
          Auto generated method comment
 Role getRole(java.lang.String r)
           
 Role getRoleByUuid(java.lang.String uuid)
          Auto generated method comment
 User getUser(java.lang.Integer userId)
           
 User getUserByUsername(java.lang.String username)
           
 User getUserByUuid(java.lang.String uuid)
          Auto generated method comment
 java.util.List<User> getUsers(java.lang.String nameSearch, java.util.List<Role> roles, boolean includeVoided)
           
 java.util.List<User> getUsersByName(java.lang.String givenName, java.lang.String familyName, boolean includeVoided)
           
 java.util.List<User> getUsersByPerson(Person person, boolean includeRetired)
           
 boolean hasDuplicateUsername(java.lang.String username, java.lang.String systemId, java.lang.Integer userId)
           
 boolean isSecretAnswer(User u, java.lang.String answer)
           
 Privilege savePrivilege(Privilege privilege)
           
 Role saveRole(Role role)
           
 User saveUser(User user, java.lang.String password)
           
 void updateLoginCredential(LoginCredential credential)
          Updates a user's login credentials.
 

Method Detail

saveUser

User saveUser(User user,
              java.lang.String password)
              throws DAOException
Throws:
DAOException
See Also:
UserService.saveUser(org.openmrs.User, java.lang.String)

getUser

User getUser(java.lang.Integer userId)
             throws DAOException
Throws:
DAOException
See Also:
UserService.getUser(Integer)

getUserByUsername

User getUserByUsername(java.lang.String username)
                       throws DAOException
Throws:
DAOException
See Also:
UserService.getUserByUsername(java.lang.String)

hasDuplicateUsername

boolean hasDuplicateUsername(java.lang.String username,
                             java.lang.String systemId,
                             java.lang.Integer userId)
                             throws DAOException
Throws:
DAOException
See Also:
UserService.hasDuplicateUsername(org.openmrs.User)

deleteUser

void deleteUser(User user)
                throws DAOException
Throws:
DAOException
See Also:
UserService.purgeUser(org.openmrs.User)

getAllUsers

java.util.List<User> getAllUsers()
                                 throws DAOException
Throws:
DAOException
See Also:
UserService.getAllUsers()

saveRole

Role saveRole(Role role)
              throws DAOException
Throws:
DAOException
See Also:
UserService.saveRole(org.openmrs.Role)

deleteRole

void deleteRole(Role role)
                throws DAOException
Throws:
DAOException
See Also:
UserService.purgeRole(org.openmrs.Role)

getRole

Role getRole(java.lang.String r)
             throws DAOException
Throws:
DAOException
See Also:
UserService.getRole(java.lang.String)

getAllRoles

java.util.List<Role> getAllRoles()
                                 throws DAOException
Throws:
DAOException
See Also:
UserService.getAllRoles()

savePrivilege

Privilege savePrivilege(Privilege privilege)
                        throws DAOException
Throws:
DAOException
See Also:
UserService.savePrivilege(org.openmrs.Privilege)

getPrivilege

Privilege getPrivilege(java.lang.String p)
                       throws DAOException
Throws:
DAOException
See Also:
UserService.getPrivilege(java.lang.String)

getAllPrivileges

java.util.List<Privilege> getAllPrivileges()
                                           throws DAOException
Throws:
DAOException
See Also:
UserService.getAllPrivileges()

deletePrivilege

void deletePrivilege(Privilege privilege)
                     throws DAOException
Throws:
DAOException
See Also:
UserService.purgePrivilege(org.openmrs.Privilege)

getUsers

java.util.List<User> getUsers(java.lang.String nameSearch,
                              java.util.List<Role> roles,
                              boolean includeVoided)
                              throws DAOException
Throws:
DAOException
See Also:
UserService.getUsers(java.lang.String, java.util.List, boolean)
Expected behavior:
escape sql wildcards in searchPhrase

getUsersByName

java.util.List<User> getUsersByName(java.lang.String givenName,
                                    java.lang.String familyName,
                                    boolean includeVoided)
See Also:
UserService.getUsersByName(java.lang.String, java.lang.String, boolean)

changePassword

void changePassword(User u,
                    java.lang.String pw)
                    throws DAOException
Throws:
DAOException
See Also:
UserService.changePassword(org.openmrs.User, java.lang.String)

changePassword

void changePassword(java.lang.String pw,
                    java.lang.String pw2)
                    throws DAOException
Throws:
DAOException
See Also:
UserService.changePassword(java.lang.String, java.lang.String)

changeHashedPassword

void changeHashedPassword(User user,
                          java.lang.String hashedPassword,
                          java.lang.String salt)
                          throws DAOException
Throws:
DAOException
See Also:
UserService.changeHashedPassword(User, String, String)

changeQuestionAnswer

void changeQuestionAnswer(User u,
                          java.lang.String question,
                          java.lang.String answer)
                          throws DAOException
Throws:
DAOException
See Also:
UserService.changeQuestionAnswer(User, String, String)

changeQuestionAnswer

void changeQuestionAnswer(java.lang.String pw,
                          java.lang.String q,
                          java.lang.String a)
                          throws DAOException
Throws:
DAOException
See Also:
UserService.changeQuestionAnswer(java.lang.String, java.lang.String, java.lang.String)

isSecretAnswer

boolean isSecretAnswer(User u,
                       java.lang.String answer)
                       throws DAOException
Throws:
DAOException
See Also:
UserService.isSecretAnswer(org.openmrs.User, java.lang.String)

getPrivilegeByUuid

Privilege getPrivilegeByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

getRoleByUuid

Role getRoleByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

getUserByUuid

User getUserByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

getLoginCredential

LoginCredential getLoginCredential(User user)
Parameters:
user -
Returns:
The login credentials for a specified user.

getLoginCredentialByUuid

LoginCredential getLoginCredentialByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

updateLoginCredential

void updateLoginCredential(LoginCredential credential)
Updates a user's login credentials. Note that there is no createLoginCredential(LoginCredential) method. Login credentials are dependent on a User already existing.

Parameters:
credential -

generateSystemId

java.lang.Integer generateSystemId()
                                   throws DAOException
Throws:
DAOException
See Also:
UserService.generateSystemId()

getUsersByPerson

java.util.List<User> getUsersByPerson(Person person,
                                      boolean includeRetired)
See Also:
UserService.getUsersByPerson(Person, boolean)

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change