mirror of https://github.com/apache/cloudstack.git
keep deleted projects name (#7858)
Co-authored-by: Henrique Sato <henrique.sato@scclouds.com.br>
This commit is contained in:
parent
7541cb97bd
commit
8d81ec425d
|
|
@ -33,7 +33,6 @@ import com.cloud.utils.db.GenericSearchBuilder;
|
|||
import com.cloud.utils.db.SearchBuilder;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
import com.cloud.utils.db.SearchCriteria.Func;
|
||||
import com.cloud.utils.db.TransactionLegacy;
|
||||
|
||||
@Component
|
||||
public class ProjectDaoImpl extends GenericDaoBase<ProjectVO, Long> implements ProjectDao {
|
||||
|
|
@ -71,22 +70,8 @@ public class ProjectDaoImpl extends GenericDaoBase<ProjectVO, Long> implements P
|
|||
@Override
|
||||
@DB
|
||||
public boolean remove(Long projectId) {
|
||||
boolean result = false;
|
||||
TransactionLegacy txn = TransactionLegacy.currentTxn();
|
||||
txn.start();
|
||||
ProjectVO projectToRemove = findById(projectId);
|
||||
projectToRemove.setName(null);
|
||||
if (!update(projectId, projectToRemove)) {
|
||||
s_logger.warn("Failed to reset name for the project id=" + projectId + " as a part of project remove");
|
||||
return false;
|
||||
}
|
||||
|
||||
_tagsDao.removeByIdAndType(projectId, ResourceObjectType.Project);
|
||||
result = super.remove(projectId);
|
||||
txn.commit();
|
||||
|
||||
return result;
|
||||
|
||||
return super.remove(projectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue