org.pentaho.platform.engine.security.userroledao.hibernate
Class HibernateUserRoleDao
java.lang.Object
  
org.springframework.dao.support.DaoSupport
      
org.springframework.orm.hibernate3.support.HibernateDaoSupport
          
org.pentaho.platform.engine.security.userroledao.hibernate.HibernateUserRoleDao
- All Implemented Interfaces: 
 - IUserRoleDao, org.springframework.beans.factory.InitializingBean
 
public class HibernateUserRoleDao
- extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
- implements IUserRoleDao
  
An IUserRoleDao that uses Hibernate. Furthermore, it uses Spring's HibernateDaoSupport. This 
 allows instances to be dependency injected. At a minimum, instances require a Hibernate SessionFactory.
 
 
The init method must be called after all properties have been set and before calling any of the CRUD 
 methods. Can be called automatically if using Spring via the init-method attribute. Otherwise, call it 
 manually after setting all properties.
- Author:
 
  - mlowery
 
 
 
 
 
| Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport | 
getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory | 
 
| Methods inherited from class org.springframework.dao.support.DaoSupport | 
afterPropertiesSet | 
 
 
DEFAULT_ALL_USERS_QUERY
public static final String DEFAULT_ALL_USERS_QUERY
- See Also:
 - Constant Field Values
 
DEFAULT_ALL_ROLES_QUERY
public static final String DEFAULT_ALL_ROLES_QUERY
- See Also:
 - Constant Field Values
 
HibernateUserRoleDao
public HibernateUserRoleDao()
init
public void init()
- A generic initialization method. Can be used to load initial data into user- and role-related tables.
 
 
 
createUser
public void createUser(IPentahoUser userToCreate)
                throws AlreadyExistsException,
                       UncategorizedUserRoleDaoException
- Specified by:
 createUser in interface IUserRoleDao
 
- Throws:
 AlreadyExistsException
UncategorizedUserRoleDaoException
 
deleteUser
public void deleteUser(IPentahoUser userToDelete)
                throws NotFoundException,
                       UncategorizedUserRoleDaoException
- Specified by:
 deleteUser in interface IUserRoleDao
 
- Throws:
 NotFoundException
UncategorizedUserRoleDaoException
 
getUser
public IPentahoUser getUser(String username)
                     throws UncategorizedUserRoleDaoException
- Specified by:
 getUser in interface IUserRoleDao
 
- Throws:
 UncategorizedUserRoleDaoException
 
getUsers
public List<IPentahoUser> getUsers()
                            throws UncategorizedUserRoleDaoException
- Specified by:
 getUsers in interface IUserRoleDao
 
- Throws:
 UncategorizedUserRoleDaoException
 
updateUser
public void updateUser(IPentahoUser userToUpdate)
                throws NotFoundException,
                       UncategorizedUserRoleDaoException
- Specified by:
 updateUser in interface IUserRoleDao
 
- Throws:
 NotFoundException
UncategorizedUserRoleDaoException
 
createRole
public void createRole(IPentahoRole roleToCreate)
                throws AlreadyExistsException,
                       UncategorizedUserRoleDaoException
- This method is more complex because this is the inverse end of a bidirectional many-to-many relationship. See 
 Hibernate documentation section 6.3.2. Bidirectional associations. Basically, this means that the users set of this
 role must be managed manually.
- Specified by:
 createRole in interface IUserRoleDao
 
- Throws:
 AlreadyExistsException
UncategorizedUserRoleDaoException
 
 
deleteRole
public void deleteRole(IPentahoRole roleToDelete)
                throws NotFoundException,
                       UncategorizedUserRoleDaoException
- This method is more complex because this is the inverse end of a bidirectional many-to-many relationship. See 
 Hibernate documentation section 6.3.2. Bidirectional associations. Basically, this means that the users set of this
 role must be managed manually.
- Specified by:
 deleteRole in interface IUserRoleDao
 
- Throws:
 NotFoundException
UncategorizedUserRoleDaoException
 
 
getRole
public IPentahoRole getRole(String name)
                     throws UncategorizedUserRoleDaoException
- Specified by:
 getRole in interface IUserRoleDao
 
- Throws:
 UncategorizedUserRoleDaoException
 
getRoles
public List<IPentahoRole> getRoles()
                            throws UncategorizedUserRoleDaoException
- Specified by:
 getRoles in interface IUserRoleDao
 
- Throws:
 UncategorizedUserRoleDaoException
 
updateRole
public void updateRole(IPentahoRole roleToUpdate)
                throws NotFoundException,
                       UncategorizedUserRoleDaoException
- This method is more complex because this is the inverse end of a bidirectional many-to-many relationship. See 
 Hibernate documentation section 6.3.2. Bidirectional associations. Basically, this means that the users set of this
 role must be managed manually.
- Specified by:
 updateRole in interface IUserRoleDao
 
- Throws:
 NotFoundException
UncategorizedUserRoleDaoException
 
 
setAllUsersQuery
public void setAllUsersQuery(String allUsersQuery)
 
 
getAllUsersQuery
public String getAllUsersQuery()
 
 
setAllRolesQuery
public void setAllRolesQuery(String allRolesQuery)
 
 
getAllRolesQuery
public String getAllRolesQuery()
 
 
setInitHandler
public void setInitHandler(HibernateUserRoleDao.InitHandler initHandler)