Resource tags: CS-15647 - delete resource tags when SG is expunged

This commit is contained in:
Alena Prokharchyk 2012-07-23 10:32:56 -07:00
parent ef05939910
commit cec0ea54ec
1 changed files with 14 additions and 0 deletions

View File

@ -109,5 +109,19 @@ public class SecurityGroupDaoImpl extends GenericDaoBase<SecurityGroupVO, Long>
boolean result = super.remove(id);
txn.commit();
return result;
}
@Override
@DB
public boolean expunge(Long id) {
Transaction txn = Transaction.currentTxn();
txn.start();
SecurityGroupVO entry = findById(id);
if (entry != null) {
_tagsDao.removeByIdAndType(id, TaggedResourceType.SecurityGroup);
}
boolean result = super.expunge(id);
txn.commit();
return result;
}
}