Commit bd841e00 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Delete group propertis when deleting a group.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@836 b35dd754-fafc-0310-a699-88a17e54d16e
parent de3eeee3
...@@ -42,6 +42,8 @@ public class DefaultGroupProvider implements GroupProvider { ...@@ -42,6 +42,8 @@ public class DefaultGroupProvider implements GroupProvider {
"UPDATE jiveGroupUser SET groupName=? WHERE groupName=?"; "UPDATE jiveGroupUser SET groupName=? WHERE groupName=?";
private static final String DELETE_GROUP_USERS = private static final String DELETE_GROUP_USERS =
"DELETE FROM jiveGroupUser WHERE groupName=?"; "DELETE FROM jiveGroupUser WHERE groupName=?";
private static final String DELETE_PROPERTIES =
"DELETE FROM jiveGroupProp WHERE groupName=?";
private static final String DELETE_GROUP = private static final String DELETE_GROUP =
"DELETE FROM jiveGroup WHERE groupName=?"; "DELETE FROM jiveGroup WHERE groupName=?";
private static final String GROUP_COUNT = "SELECT count(*) FROM jiveGroup"; private static final String GROUP_COUNT = "SELECT count(*) FROM jiveGroup";
...@@ -182,6 +184,11 @@ public class DefaultGroupProvider implements GroupProvider { ...@@ -182,6 +184,11 @@ public class DefaultGroupProvider implements GroupProvider {
pstmt.setString(1, groupName); pstmt.setString(1, groupName);
pstmt.executeUpdate(); pstmt.executeUpdate();
pstmt.close(); pstmt.close();
// Remove all properties of the group.
pstmt = con.prepareStatement(DELETE_PROPERTIES);
pstmt.setString(1, groupName);
pstmt.executeUpdate();
pstmt.close();
// Remove the group entry. // Remove the group entry.
pstmt = con.prepareStatement(DELETE_GROUP); pstmt = con.prepareStatement(DELETE_GROUP);
pstmt.setString(1, groupName); pstmt.setString(1, groupName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment