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 4c6e547e70
commit 65551cff82

View File

@ -113,5 +113,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;
}
}