Description
There arent any change log events on group.delete() for types (and maybe attributes). Here is the cause:
Hib3GroupDao:
// delete attributes
ByHql byHql = hibernateSession.byHql();
byHql.createQuery("delete from Attribute where group_id = :group");
byHql.setString("group", _g.getUuid() );
byHql.executeUpdate();
// delete type tuples
byHql = hibernateSession.byHql();
byHql.createQuery("delete from GroupTypeTuple where group_uuid = :group");
byHql.setString("group", _g.getUuid() );
byHql.executeUpdate();
Here is a potential solution from Peter DiCamillo (though we probably just want to select the objects and call .delete() on them so they are processed normally with hooks etc:
Index: Group.java
===================================================================
— Group.java (revision 7442)
+++ Group.java (working copy)
@@ -1198,6 +1198,18 @@
attributeAssign.delete();
}
+ // generate an unassign event for each type the group has
+ Set<GroupType> groupTypes = Group.this.getTypes();
+ for (GroupType groupType : groupTypes)
+
//deletes.add(this); // ... And add the group last for good luck
String name = Group.this.getName(); // Preserve name for logging
GrouperDAOFactory.getFactory().getGroup().delete(Group.this);