From 79725f9924bf4b8951f10163ef8bb554af32b4b7 Mon Sep 17 00:00:00 2001 From: anhefti Date: Fri, 23 Aug 2019 13:39:11 +0200 Subject: [PATCH] preparing demo --- .../impl/ConfigurationDAOBatchService.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java index 34358806..2dc3a73c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java @@ -76,12 +76,26 @@ class ConfigurationDAOBatchService { protected ConfigurationDAOBatchService( @Qualifier(BatisConfig.SQL_BATCH_SESSION_TEMPLATE) final SqlSessionTemplate batchSqlSessionTemplate) { - log.info("Registered MyBatis Mappers: {}", - batchSqlSessionTemplate.getConfiguration().getMapperRegistry().getMappers()); + final org.apache.ibatis.session.Configuration batisConfig = + batchSqlSessionTemplate.getConfiguration(); + + log.info("Registered MyBatis Mappers: {}", batisConfig.getMapperRegistry().getMappers()); // NOTE: sometimes this mapper was not registered on startup. No reason why. Force loading if absent. - if (!batchSqlSessionTemplate.getConfiguration().hasMapper(ConfigurationNodeRecordMapper.class)) { - batchSqlSessionTemplate.getConfiguration().addMapper(ConfigurationNodeRecordMapper.class); + if (!batisConfig.hasMapper(ConfigurationNodeRecordMapper.class)) { + batisConfig.addMapper(ConfigurationNodeRecordMapper.class); + } + + if (!batisConfig.hasMapper(ConfigurationValueRecordMapper.class)) { + batisConfig.addMapper(ConfigurationValueRecordMapper.class); + } + + if (!batisConfig.hasMapper(ConfigurationAttributeRecordMapper.class)) { + batisConfig.addMapper(ConfigurationAttributeRecordMapper.class); + } + + if (!batisConfig.hasMapper(ConfigurationRecordMapper.class)) { + batisConfig.addMapper(ConfigurationRecordMapper.class); } this.batchConfigurationNodeRecordMapper =