Class GroupUserRoleTable
- java.lang.Object
-
- org.silverpeas.core.persistence.jdbc.AbstractTable<T>
-
- org.silverpeas.core.admin.persistence.Table<GroupUserRoleRow>
-
- org.silverpeas.core.admin.persistence.GroupUserRoleTable
-
@Repository public class GroupUserRoleTable extends Table<GroupUserRoleRow>
A GroupUserRoleTable object manages the ST_GroupUserRole table.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGroupInGroupUserRole(int groupId, int groupUserRoleId)
Adds a group in a groupUserRole.void
addUserInGroupUserRole(int userId, int groupUserRoleId)
Add an user in a groupUserRole.void
createGroupUserRole(GroupUserRoleRow groupUserRole)
Inserts in the database a new groupUserRole row.protected GroupUserRoleRow
fetchGroupUserRole(ResultSet rs)
Fetch the current groupUserRole row from a resultSet.protected GroupUserRoleRow
fetchRow(ResultSet rs)
Fetch the current groupUserRole row from a resultSet.GroupUserRoleRow[]
getDirectGroupUserRolesOfGroup(int groupId)
Returns all the direct GroupUserRoles of a group.GroupUserRoleRow[]
getDirectGroupUserRolesOfUser(int userId)
Returns all the direct GroupUserRoles of user.GroupUserRoleRow
getGroupUserRole(int id)
Returns the GroupUserRole whith the given id.GroupUserRoleRow
getGroupUserRoleByGroupId(int groupId)
Returns the GroupUserRole whith the given groupId.protected void
prepareInsert(String insertQuery, PreparedStatement insert, GroupUserRoleRow usr)
protected void
prepareUpdate(String updateQuery, PreparedStatement update, GroupUserRoleRow row)
void
removeGroupFromGroupUserRole(int groupId, int groupUserRoleId)
Removes a group from a groupUserRole.void
removeGroupUserRole(int id)
Delete the groupUserRolevoid
removeUserFromGroupUserRole(int userId, int groupUserRoleId)
Removes an user from a groupUserRole.-
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
-
-
-
-
Method Detail
-
fetchGroupUserRole
protected GroupUserRoleRow fetchGroupUserRole(ResultSet rs) throws SQLException
Fetch the current groupUserRole row from a resultSet.- Throws:
SQLException
-
getGroupUserRole
public GroupUserRoleRow getGroupUserRole(int id) throws SQLException
Returns the GroupUserRole whith the given id.- Throws:
SQLException
-
getGroupUserRoleByGroupId
public GroupUserRoleRow getGroupUserRoleByGroupId(int groupId) throws SQLException
Returns the GroupUserRole whith the given groupId.- Throws:
SQLException
-
getDirectGroupUserRolesOfUser
public GroupUserRoleRow[] getDirectGroupUserRolesOfUser(int userId) throws SQLException
Returns all the direct GroupUserRoles of user.- Throws:
SQLException
-
getDirectGroupUserRolesOfGroup
public GroupUserRoleRow[] getDirectGroupUserRolesOfGroup(int groupId) throws SQLException
Returns all the direct GroupUserRoles of a group.- Throws:
SQLException
-
createGroupUserRole
public void createGroupUserRole(GroupUserRoleRow groupUserRole) throws SQLException
Inserts in the database a new groupUserRole row.- Throws:
SQLException
-
prepareInsert
protected void prepareInsert(String insertQuery, PreparedStatement insert, GroupUserRoleRow usr) throws SQLException
- Specified by:
prepareInsert
in classAbstractTable<GroupUserRoleRow>
- Throws:
SQLException
-
prepareUpdate
protected void prepareUpdate(String updateQuery, PreparedStatement update, GroupUserRoleRow row) throws SQLException
- Specified by:
prepareUpdate
in classAbstractTable<GroupUserRoleRow>
- Throws:
SQLException
-
removeGroupUserRole
public void removeGroupUserRole(int id) throws SQLException
Delete the groupUserRole- Throws:
SQLException
-
addUserInGroupUserRole
public void addUserInGroupUserRole(int userId, int groupUserRoleId) throws SQLException
Add an user in a groupUserRole.- Throws:
SQLException
-
removeUserFromGroupUserRole
public void removeUserFromGroupUserRole(int userId, int groupUserRoleId) throws SQLException
Removes an user from a groupUserRole.- Throws:
SQLException
-
addGroupInGroupUserRole
public void addGroupInGroupUserRole(int groupId, int groupUserRoleId) throws SQLException
Adds a group in a groupUserRole.- Throws:
SQLException
-
removeGroupFromGroupUserRole
public void removeGroupFromGroupUserRole(int groupId, int groupUserRoleId) throws SQLException
Removes a group from a groupUserRole.- Throws:
SQLException
-
fetchRow
protected GroupUserRoleRow fetchRow(ResultSet rs) throws SQLException
Fetch the current groupUserRole row from a resultSet.- Specified by:
fetchRow
in classAbstractTable<GroupUserRoleRow>
- Parameters:
rs
- the result set from which the row will be fetched.- Returns:
- the entity in the row.
- Throws:
SQLException
- on SQL error.
-
-