Class SpaceUserRoleTable
- java.lang.Object
-
- org.silverpeas.core.persistence.jdbc.AbstractTable<T>
-
- org.silverpeas.core.admin.persistence.Table<SpaceUserRoleRow>
-
- org.silverpeas.core.admin.persistence.SpaceUserRoleTable
-
@Repository public class SpaceUserRoleTable extends Table<SpaceUserRoleRow>
A SpaceUserRoleTable object manages the ST_SpaceUserRole table.
-
-
Field Summary
Fields Modifier and Type Field Description static String
REQUEST_MSG
static String
SELECT
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGroupInSpaceUserRole(int groupId, int spaceUserRoleId)
Adds a group in a spaceUserRole.void
addUserInSpaceUserRole(int userId, int spaceUserRoleId)
Add an user in a spaceUserRole.void
createSpaceUserRole(SpaceUserRoleRow spaceUserRole)
Inserts in the database a new spaceUserRole row.protected SpaceUserRoleRow
fetchRow(ResultSet rs)
Fetch the current spaceUserRole row from a resultSet.SpaceUserRoleRow[]
getAllMatchingSpaceUserRoles(SpaceUserRoleRow sampleSpaceUserRole)
Returns the SpaceUserRole whose fields match those of the given sample SpaceUserRole fields.String[]
getAllSpaceUserRoleIdsOfSpace(int spaceId)
Returns all the SpaceUserRole ids of a space.SpaceUserRoleRow[]
getAllSpaceUserRoles()
Returns all the SpaceUserRoles.SpaceUserRoleRow[]
getAllSpaceUserRolesOfSpace(int spaceId)
Returns all the SpaceUserRoles of a space.SpaceUserRoleRow[]
getDirectSpaceUserRolesOfGroup(int groupId)
Returns all the direct SpaceUserRoles of a group.SpaceUserRoleRow[]
getDirectSpaceUserRolesOfUser(int userId)
Returns all the direct SpaceUserRoles of user.SpaceUserRoleRow
getSpaceUserRole(int id)
Returns the SpaceUserRole whith the given id.SpaceUserRoleRow
getSpaceUserRole(int spaceId, String roleName, int inherited)
Returns the SpaceUserRole whith the given RoleName in the given space.boolean
isGroupDirectlyInRole(int groupId, int spaceUserRoleId)
Tests if a group has a given role (not recursive).boolean
isUserDirectlyInRole(int userId, int spaceUserRoleId)
Tests if a user has a given role (not recursive).protected void
prepareInsert(String insertQuery, PreparedStatement insert, SpaceUserRoleRow row)
protected void
prepareUpdate(String updateQuery, PreparedStatement update, SpaceUserRoleRow row)
void
removeAllGroupsFromSpaceUserRole(int spaceUserRoleId)
Removes all groups from a spaceUserRole.void
removeAllUsersFromSpaceUserRole(int spaceUserRoleId)
Removes all users from a spaceUserRole.void
removeGroupFromSpaceUserRole(int groupId, int spaceUserRoleId)
Removes a group from a spaceUserRole.void
removeSpaceUserRole(int id)
Delete the spaceUserRolevoid
removeUserFromSpaceUserRole(int userId, int spaceUserRoleId)
Removes an user from a spaceUserRole.void
updateSpaceUserRole(SpaceUserRoleRow spaceUserRole)
Updates a spaceUserRole-
Methods inherited from class org.silverpeas.core.admin.persistence.Table
addIdToQuery, addParamToQuery, addParamToQuery, aliasColumns, checkGroupExistence, checkUserExistence, getCount, getCount, getIds, getIds, getIds, getIds, getNotNullString, getRows, performPrepareStatementParams, updateRelation
-
Methods inherited from class org.silverpeas.core.persistence.jdbc.AbstractTable
getInteger, getInteger, getMatchingRows, getNextId, getRows, getRows, getRows, getRows, getRows, getRows, getRows, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, insertRow, truncate, updateRelation, updateRelation, updateRow
-
-
-
-
Field Detail
-
REQUEST_MSG
public static final String REQUEST_MSG
- See Also:
- Constant Field Values
-
SELECT
public static final String SELECT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSpaceUserRole
public SpaceUserRoleRow getSpaceUserRole(int id) throws SQLException
Returns the SpaceUserRole whith the given id.- Throws:
SQLException
-
getSpaceUserRole
public SpaceUserRoleRow getSpaceUserRole(int spaceId, String roleName, int inherited) throws SQLException
Returns the SpaceUserRole whith the given RoleName in the given space.- Throws:
SQLException
-
getAllSpaceUserRoles
public SpaceUserRoleRow[] getAllSpaceUserRoles() throws SQLException
Returns all the SpaceUserRoles.- Throws:
SQLException
-
getAllSpaceUserRolesOfSpace
public SpaceUserRoleRow[] getAllSpaceUserRolesOfSpace(int spaceId) throws SQLException
Returns all the SpaceUserRoles of a space.- Throws:
SQLException
-
getAllSpaceUserRoleIdsOfSpace
public String[] getAllSpaceUserRoleIdsOfSpace(int spaceId) throws SQLException
Returns all the SpaceUserRole ids of a space.- Throws:
SQLException
-
getDirectSpaceUserRolesOfUser
public SpaceUserRoleRow[] getDirectSpaceUserRolesOfUser(int userId) throws SQLException
Returns all the direct SpaceUserRoles of user.- Throws:
SQLException
-
getDirectSpaceUserRolesOfGroup
public SpaceUserRoleRow[] getDirectSpaceUserRolesOfGroup(int groupId) throws SQLException
Returns all the direct SpaceUserRoles of a group.- Throws:
SQLException
-
getAllMatchingSpaceUserRoles
public SpaceUserRoleRow[] getAllMatchingSpaceUserRoles(SpaceUserRoleRow sampleSpaceUserRole) throws SQLException
Returns the SpaceUserRole whose fields match those of the given sample SpaceUserRole fields.- Throws:
SQLException
-
createSpaceUserRole
public void createSpaceUserRole(SpaceUserRoleRow spaceUserRole) throws SQLException
Inserts in the database a new spaceUserRole row.- Throws:
SQLException
-
prepareInsert
protected void prepareInsert(String insertQuery, PreparedStatement insert, SpaceUserRoleRow row) throws SQLException
- Specified by:
prepareInsert
in classAbstractTable<SpaceUserRoleRow>
- Throws:
SQLException
-
updateSpaceUserRole
public void updateSpaceUserRole(SpaceUserRoleRow spaceUserRole) throws SQLException
Updates a spaceUserRole- Throws:
SQLException
-
prepareUpdate
protected void prepareUpdate(String updateQuery, PreparedStatement update, SpaceUserRoleRow row) throws SQLException
- Specified by:
prepareUpdate
in classAbstractTable<SpaceUserRoleRow>
- Throws:
SQLException
-
removeSpaceUserRole
public void removeSpaceUserRole(int id) throws SQLException
Delete the spaceUserRole- Throws:
SQLException
-
isUserDirectlyInRole
public boolean isUserDirectlyInRole(int userId, int spaceUserRoleId) throws SQLException
Tests if a user has a given role (not recursive).- Throws:
SQLException
-
addUserInSpaceUserRole
public void addUserInSpaceUserRole(int userId, int spaceUserRoleId) throws SQLException
Add an user in a spaceUserRole.- Throws:
SQLException
-
removeUserFromSpaceUserRole
public void removeUserFromSpaceUserRole(int userId, int spaceUserRoleId) throws SQLException
Removes an user from a spaceUserRole.- Throws:
SQLException
-
removeAllUsersFromSpaceUserRole
public void removeAllUsersFromSpaceUserRole(int spaceUserRoleId) throws SQLException
Removes all users from a spaceUserRole.- Throws:
SQLException
-
isGroupDirectlyInRole
public boolean isGroupDirectlyInRole(int groupId, int spaceUserRoleId) throws SQLException
Tests if a group has a given role (not recursive).- Throws:
SQLException
-
addGroupInSpaceUserRole
public void addGroupInSpaceUserRole(int groupId, int spaceUserRoleId) throws SQLException
Adds a group in a spaceUserRole.- Throws:
SQLException
-
removeGroupFromSpaceUserRole
public void removeGroupFromSpaceUserRole(int groupId, int spaceUserRoleId) throws SQLException
Removes a group from a spaceUserRole.- Throws:
SQLException
-
removeAllGroupsFromSpaceUserRole
public void removeAllGroupsFromSpaceUserRole(int spaceUserRoleId) throws SQLException
Removes all groups from a spaceUserRole.- Throws:
SQLException
-
fetchRow
protected SpaceUserRoleRow fetchRow(ResultSet rs) throws SQLException
Fetch the current spaceUserRole row from a resultSet.- Specified by:
fetchRow
in classAbstractTable<SpaceUserRoleRow>
- Parameters:
rs
- the result set from which the row will be fetched.- Returns:
- the entity in the row.
- Throws:
SQLException
- on SQL error.
-
-