SEBSERV-64 code cleanup

This commit is contained in:
anhefti 2019-06-25 10:24:51 +02:00
parent 5c5edd85ad
commit 54eea01dc2
2 changed files with 2 additions and 37 deletions

View file

@ -56,6 +56,8 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundExcepti
@Lazy @Lazy
@Component @Component
@WebServiceProfile @WebServiceProfile
/** This service is internally used to implement MyBatis batch functionality for the most
* intensive write operation on Configuration domain. */
class ConfigurationDAOBatchService { class ConfigurationDAOBatchService {
private final ConfigurationNodeRecordMapper batchConfigurationNodeRecordMapper; private final ConfigurationNodeRecordMapper batchConfigurationNodeRecordMapper;

View file

@ -55,7 +55,6 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO {
private final ConfigurationRecordMapper configurationRecordMapper; private final ConfigurationRecordMapper configurationRecordMapper;
private final ConfigurationNodeRecordMapper configurationNodeRecordMapper; private final ConfigurationNodeRecordMapper configurationNodeRecordMapper;
private final ConfigurationValueRecordMapper configurationValueRecordMapper; private final ConfigurationValueRecordMapper configurationValueRecordMapper;
private final ConfigurationAttributeRecordMapper configurationAttributeRecordMapper;
private final ConfigurationDAOBatchService configurationDAOBatchService; private final ConfigurationDAOBatchService configurationDAOBatchService;
protected ConfigurationNodeDAOImpl( protected ConfigurationNodeDAOImpl(
@ -68,7 +67,6 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO {
this.configurationRecordMapper = configurationRecordMapper; this.configurationRecordMapper = configurationRecordMapper;
this.configurationNodeRecordMapper = configurationNodeRecordMapper; this.configurationNodeRecordMapper = configurationNodeRecordMapper;
this.configurationValueRecordMapper = configurationValueRecordMapper; this.configurationValueRecordMapper = configurationValueRecordMapper;
this.configurationAttributeRecordMapper = configurationAttributeRecordMapper;
this.configurationDAOBatchService = ConfigurationDAOBatchService; this.configurationDAOBatchService = ConfigurationDAOBatchService;
} }
@ -152,41 +150,6 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO {
return this.configurationDAOBatchService return this.configurationDAOBatchService
.createNewConfiguration(data) .createNewConfiguration(data)
.onError(TransactionHandler::rollback); .onError(TransactionHandler::rollback);
/*
* return Result.tryCatch(() -> {
*
* final Long count = this.configurationNodeRecordMapper.countByExample()
* .where(
* ConfigurationNodeRecordDynamicSqlSupport.name,
* isEqualTo(data.name))
* .and(
* ConfigurationNodeRecordDynamicSqlSupport.institutionId,
* SqlBuilder.isEqualTo(data.institutionId))
* .build()
* .execute();
*
* if (count != null && count.longValue() > 0) {
* throw new FieldValidationException("name", "configurationNode:name:exists");
* }
*
* final ConfigurationNodeRecord newRecord = new ConfigurationNodeRecord(
* null,
* data.institutionId,
* data.templateId,
* data.owner,
* data.name,
* data.description,
* data.type.name(),
* (data.status != null) ? data.status.name() : ConfigurationStatus.CONSTRUCTION.name());
*
* this.configurationNodeRecordMapper.insert(newRecord);
* return newRecord;
* })
* .flatMap(ConfigurationNodeDAOImpl::toDomainModel)
* .flatMap(this::createInitialConfiguration)
* .onError(TransactionHandler::rollback);
*/
} }
@Override @Override