use of org.orcid.core.exception.OrcidElementCantBeDeletedException in project ORCID-Source by ORCID.
the class GroupIdRecordManagerImpl method deleteGroupIdRecord.
@Override
public void deleteGroupIdRecord(Long putCode) {
GroupIdRecordEntity existingEntity = groupIdRecordDao.find(putCode);
if (existingEntity != null) {
if (groupIdRecordDao.haveAnyPeerReview(existingEntity.getGroupId())) {
throw new OrcidElementCantBeDeletedException("Unable to delete group id because there are peer reviews associated to it");
}
orcidSecurityManager.checkSource(existingEntity);
groupIdRecordDao.remove(Long.valueOf(putCode));
} else {
throw new GroupIdRecordNotFoundException();
}
}
use of org.orcid.core.exception.OrcidElementCantBeDeletedException in project ORCID-Source by ORCID.
the class GroupIdRecordManagerImpl method deleteGroupIdRecord.
@Override
public void deleteGroupIdRecord(Long putCode) {
GroupIdRecordEntity existingEntity = groupIdRecordDao.find(putCode);
if (existingEntity != null) {
if (groupIdRecordDao.haveAnyPeerReview(existingEntity.getGroupId())) {
throw new OrcidElementCantBeDeletedException("Unable to delete group id because there are peer reviews associated to it");
}
orcidSecurityManager.checkSource(existingEntity);
groupIdRecordDao.remove(Long.valueOf(putCode));
} else {
throw new GroupIdRecordNotFoundException();
}
}
Aggregations