public class RoleDAO
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private org.hibernate.Session |
ss |
Constructor and Description |
---|
RoleDAO()
Constructor of the class - only thing to do here is to open session to DB
|
Modifier and Type | Method and Description |
---|---|
void |
closeSession()
Method for closing the session - it flushes database connection
|
void |
deleteRole(Role role)
Method providing functionality for deleting a role
|
Role |
findRole(java.lang.String role)
Method returning role that matches role name
|
java.util.List<Role> |
getAllRoles()
Method returning List of Roles
|
java.lang.Boolean |
newRole(Role role)
Method returning providing funtionality for creating new Role
|
void |
updateRole(Role role)
Method providing functionality for updating Role entry
|
void |
updateRoleName(java.lang.String oldName,
java.lang.String newName)
Method providing functionality for updating role name
|
public RoleDAO()
public java.util.List<Role> getAllRoles()
public Role findRole(java.lang.String role)
role
- Role name we search forpublic java.lang.Boolean newRole(Role role)
role
- Role that is to be createdpublic void updateRole(Role role)
role
- Role to be updatedpublic void updateRoleName(java.lang.String oldName, java.lang.String newName)
oldName
- Old name of the rolenewName
- New name for the rolepublic void deleteRole(Role role)
role
- Role that is to be deletedpublic void closeSession()