org.bibalex.daf.entities
Class Role

java.lang.Object
  extended by org.bibalex.daf.entities.AdminModuleBase
      extended by org.bibalex.daf.entities.Role

public class Role
extends AdminModuleBase


Field Summary
private  DBConnection conn
           
private  int id
           
private  java.lang.String roleDescription
           
 
Constructor Summary
Role()
          Class Constructor
Role(DataTable table)
           
Role(int roleID)
           
 
Method Summary
 OperationInfo add()
          Add new Role
 OperationInfo delete()
          delete Role
 OperationInfo deleteCascade()
          delete Role in cascade
static OperationInfo getByID(int recID)
          select Role
 int getID()
          Gets the ID.
 OperationInfo getPermissions()
          select Role's Permissions
 java.lang.String getRoleDescription()
          get Role Description
static OperationInfo loadAll()
          Load all Roles
 void setFieldsFromDataTable(DataTable table)
           
 void setID(int roleID)
          Sets the Role ID.
 void setRoleDescription(java.lang.String Value)
          set Role Description
 OperationInfo update()
          update Role
 OperationInfo updatePermissions(java.lang.Object[] permissionIDs)
          Updates the permissions related to this role.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conn

private DBConnection conn

id

private int id

roleDescription

private java.lang.String roleDescription
Constructor Detail

Role

public Role()
Class Constructor


Role

public Role(int roleID)
     throws java.lang.Exception
Throws:
java.lang.Exception

Role

public Role(DataTable table)
     throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setFieldsFromDataTable

public void setFieldsFromDataTable(DataTable table)

loadAll

public static OperationInfo loadAll()
Load all Roles

Returns:
OperationInfo (bool, DataTable)

getByID

public static OperationInfo getByID(int recID)
select Role

Parameters:
recID - is the record to be selected
Returns:
OperationInfo (bool, DataTable) for the selected record

add

public OperationInfo add()
Add new Role

Specified by:
add in class AdminModuleBase
Returns:
OperationInfo (bool, DataTable) for the added record

delete

public OperationInfo delete()
delete Role

Specified by:
delete in class AdminModuleBase
Returns:
OperationInfo (bool, DataTable)

deleteCascade

public OperationInfo deleteCascade()
delete Role in cascade

Returns:
OperationInfo (bool, DataTable)

update

public OperationInfo update()
update Role

Specified by:
update in class AdminModuleBase
Returns:
OperationInfo (bool, DataTable) for the updated record

getPermissions

public OperationInfo getPermissions()
select Role's Permissions

Returns:
OperationInfo (bool, DataTable) for the selected Permissions

updatePermissions

public OperationInfo updatePermissions(java.lang.Object[] permissionIDs)
Updates the permissions related to this role.

Parameters:
permissionIDs -
Returns:
OperationInfo that indicates if the update was successfull or not.

setID

public void setID(int roleID)
Sets the Role ID.


setRoleDescription

public void setRoleDescription(java.lang.String Value)
set Role Description

Parameters:
Value - is the Role Description

getID

public int getID()
Gets the ID.


getRoleDescription

public java.lang.String getRoleDescription()
get Role Description

Returns:
Role Description