From 9eafb31af4b5a0b019ca3d03a0dfb0278d378883 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Fri, 23 May 2025 16:15:39 +0200 Subject: [PATCH] Move DAOs implementations to separate packages Resolves #4848 --- .../JdbcDefaultBatchConfiguration.java | 6 ++-- .../{ => jdbc}/JdbcExecutionContextDao.java | 5 +++- .../dao/{ => jdbc}/JdbcJobExecutionDao.java | 7 +++-- .../dao/{ => jdbc}/JdbcJobInstanceDao.java | 4 ++- .../dao/{ => jdbc}/JdbcStepExecutionDao.java | 6 ++-- .../MongoExecutionContextDao.java | 5 ++-- .../{ => mongodb}/MongoJobExecutionDao.java | 3 +- .../{ => mongodb}/MongoJobInstanceDao.java | 4 +-- .../MongoSequenceIncrementer.java | 4 +-- .../{ => mongodb}/MongoStepExecutionDao.java | 5 ++-- .../support/JobExplorerFactoryBean.java | 8 +++--- .../support/MongoJobExplorerFactoryBean.java | 10 +++---- .../support/JdbcJobRepositoryFactoryBean.java | 6 ++-- .../support/JobRepositoryFactoryBean.java | 4 +++ .../MongoJobRepositoryFactoryBean.java | 10 +++---- .../annotation/BatchRegistrarTests.java | 9 +++--- .../launch/JobLauncherIntegrationTests.java | 4 +-- .../dao/AbstractJobExecutionDaoTests.java | 3 +- .../dao/jdbc/CustomJobKeyGenerator.java | 28 +++++++++++++++++++ .../JdbcExecutionContextDaoTests.java | 6 ++-- .../dao/{ => jdbc}/JdbcJobDaoQueryTests.java | 4 +-- .../dao/{ => jdbc}/JdbcJobDaoTests.java | 6 ++-- .../{ => jdbc}/JdbcJobExecutionDaoTests.java | 8 ++++-- .../JdbcJobInstanceDaoCustomTests.java | 14 ++-------- .../{ => jdbc}/JdbcJobInstanceDaoTests.java | 7 +++-- .../{ => jdbc}/JdbcStepExecutionDaoTests.java | 6 ++-- ...goExecutionContextDaoIntegrationTests.java | 2 +- .../SimpleJobRepositoryIntegrationTests.java | 4 +-- ...syncChunkOrientedStepIntegrationTests.java | 2 +- .../ChunkOrientedStepIntegrationTests.java | 4 +-- .../sql-dao-custom-key-generator-test.xml | 10 +++---- .../dao/{ => jdbc}/sql-dao-test.xml | 8 +++--- 32 files changed, 130 insertions(+), 82 deletions(-) rename spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/{ => jdbc}/JdbcExecutionContextDao.java (97%) rename spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/{ => jdbc}/JdbcJobExecutionDao.java (98%) rename spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/{ => jdbc}/JdbcJobInstanceDao.java (98%) rename spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/{ => jdbc}/JdbcStepExecutionDao.java (98%) rename spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/{ => mongodb}/MongoExecutionContextDao.java (95%) rename spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/{ => mongodb}/MongoJobExecutionDao.java (98%) rename spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/{ => mongodb}/MongoJobInstanceDao.java (98%) rename spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/{ => mongodb}/MongoSequenceIncrementer.java (94%) rename spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/{ => mongodb}/MongoStepExecutionDao.java (97%) create mode 100644 spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/CustomJobKeyGenerator.java rename spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/{ => jdbc}/JdbcExecutionContextDaoTests.java (91%) rename spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/{ => jdbc}/JdbcJobDaoQueryTests.java (95%) rename spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/{ => jdbc}/JdbcJobDaoTests.java (89%) rename spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/{ => jdbc}/JdbcJobExecutionDaoTests.java (92%) rename spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/{ => jdbc}/JdbcJobInstanceDaoCustomTests.java (87%) rename spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/{ => jdbc}/JdbcJobInstanceDaoTests.java (92%) rename spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/{ => jdbc}/JdbcStepExecutionDaoTests.java (92%) rename spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/{ => jdbc}/sql-dao-custom-key-generator-test.xml (93%) rename spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/{ => jdbc}/sql-dao-test.xml (94%) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JdbcDefaultBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JdbcDefaultBatchConfiguration.java index 60c149ce9..d572d64d5 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JdbcDefaultBatchConfiguration.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JdbcDefaultBatchConfiguration.java @@ -30,9 +30,9 @@ import org.springframework.batch.core.repository.ExecutionContextSerializer; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao; import org.springframework.batch.core.repository.dao.DefaultExecutionContextSerializer; -import org.springframework.batch.core.repository.dao.JdbcExecutionContextDao; -import org.springframework.batch.core.repository.dao.JdbcJobExecutionDao; -import org.springframework.batch.core.repository.dao.JdbcStepExecutionDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcExecutionContextDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcJobExecutionDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcStepExecutionDao; import org.springframework.batch.core.repository.support.JdbcJobRepositoryFactoryBean; import org.springframework.batch.item.database.support.DataFieldMaxValueIncrementerFactory; import org.springframework.batch.item.database.support.DefaultDataFieldMaxValueIncrementerFactory; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcExecutionContextDao.java similarity index 97% rename from spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java rename to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcExecutionContextDao.java index 47b8b40c1..918c4fbc8 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcExecutionContextDao.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.jdbc; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -36,6 +36,9 @@ import java.util.concurrent.locks.ReentrantLock; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.repository.ExecutionContextSerializer; +import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao; +import org.springframework.batch.core.repository.dao.DefaultExecutionContextSerializer; +import org.springframework.batch.core.repository.dao.ExecutionContextDao; import org.springframework.batch.item.ExecutionContext; import org.springframework.core.serializer.Serializer; import org.springframework.jdbc.core.BatchPreparedStatementSetter; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobExecutionDao.java similarity index 98% rename from spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java rename to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobExecutionDao.java index 9ec0a9e2d..3ca18a19d 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobExecutionDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2023 the original author or authors. + * Copyright 2006-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.jdbc; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -46,6 +46,9 @@ import org.springframework.batch.core.converter.StringToDateConverter; import org.springframework.batch.core.converter.StringToLocalDateConverter; import org.springframework.batch.core.converter.StringToLocalDateTimeConverter; import org.springframework.batch.core.converter.StringToLocalTimeConverter; +import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao; +import org.springframework.batch.core.repository.dao.JobExecutionDao; +import org.springframework.batch.core.repository.dao.NoSuchObjectException; import org.springframework.beans.factory.InitializingBean; import org.springframework.core.convert.support.ConfigurableConversionService; import org.springframework.core.convert.support.DefaultConversionService; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobInstanceDao.java similarity index 98% rename from spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java rename to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobInstanceDao.java index 3e783ccb2..bfff1d13b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobInstanceDao.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.jdbc; import java.sql.ResultSet; import java.sql.SQLException; @@ -28,6 +28,8 @@ import org.springframework.batch.core.JobInstance; import org.springframework.batch.core.JobKeyGenerator; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.launch.NoSuchJobException; +import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao; +import org.springframework.batch.core.repository.dao.JobInstanceDao; import org.springframework.beans.factory.InitializingBean; import org.springframework.dao.DataAccessException; import org.springframework.dao.EmptyResultDataAccessException; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcStepExecutionDao.java similarity index 98% rename from spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java rename to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcStepExecutionDao.java index b1e46e0c2..11363eaa5 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcStepExecutionDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2024 the original author or authors. + * Copyright 2006-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.jdbc; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -38,6 +38,8 @@ import org.springframework.batch.core.ExitStatus; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobInstance; import org.springframework.batch.core.StepExecution; +import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao; +import org.springframework.batch.core.repository.dao.StepExecutionDao; import org.springframework.beans.factory.InitializingBean; import org.springframework.dao.OptimisticLockingFailureException; import org.springframework.jdbc.core.BatchPreparedStatementSetter; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoExecutionContextDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoExecutionContextDao.java similarity index 95% rename from spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoExecutionContextDao.java rename to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoExecutionContextDao.java index 7b3e80294..5d2f669a3 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoExecutionContextDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoExecutionContextDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.mongodb; import java.util.Collection; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.StepExecution; +import org.springframework.batch.core.repository.dao.ExecutionContextDao; import org.springframework.batch.item.ExecutionContext; import org.springframework.data.mongodb.core.MongoOperations; import org.springframework.data.mongodb.core.query.Query; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoJobExecutionDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoJobExecutionDao.java similarity index 98% rename from spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoJobExecutionDao.java rename to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoJobExecutionDao.java index da1d81ff7..477932d7e 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoJobExecutionDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoJobExecutionDao.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.mongodb; import java.util.HashSet; import java.util.List; @@ -21,6 +21,7 @@ import java.util.Set; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobInstance; +import org.springframework.batch.core.repository.dao.JobExecutionDao; import org.springframework.batch.core.repository.persistence.converter.JobExecutionConverter; import org.springframework.batch.core.repository.persistence.converter.JobInstanceConverter; import org.springframework.data.domain.Sort; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoJobInstanceDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoJobInstanceDao.java similarity index 98% rename from spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoJobInstanceDao.java rename to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoJobInstanceDao.java index a325b34bd..c433e610c 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoJobInstanceDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoJobInstanceDao.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.mongodb; import java.util.List; @@ -23,8 +23,8 @@ import org.springframework.batch.core.JobInstance; import org.springframework.batch.core.JobKeyGenerator; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.launch.NoSuchJobException; +import org.springframework.batch.core.repository.dao.JobInstanceDao; import org.springframework.batch.core.repository.persistence.converter.JobInstanceConverter; -import org.springframework.data.domain.Example; import org.springframework.data.domain.Sort; import org.springframework.data.mongodb.core.MongoOperations; import org.springframework.data.mongodb.core.query.Query; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoSequenceIncrementer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoSequenceIncrementer.java similarity index 94% rename from spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoSequenceIncrementer.java rename to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoSequenceIncrementer.java index db78dc343..9722db637 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoSequenceIncrementer.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoSequenceIncrementer.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.mongodb; import com.mongodb.client.model.FindOneAndUpdateOptions; import com.mongodb.client.model.ReturnDocument; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoStepExecutionDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoStepExecutionDao.java similarity index 97% rename from spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoStepExecutionDao.java rename to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoStepExecutionDao.java index ec9067fe6..811eb307f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoStepExecutionDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoStepExecutionDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.mongodb; import java.util.ArrayList; import java.util.Collection; @@ -24,6 +24,7 @@ import java.util.Optional; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobInstance; import org.springframework.batch.core.StepExecution; +import org.springframework.batch.core.repository.dao.StepExecutionDao; import org.springframework.batch.core.repository.persistence.converter.JobExecutionConverter; import org.springframework.batch.core.repository.persistence.converter.StepExecutionConverter; import org.springframework.data.mongodb.core.MongoOperations; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/explore/support/JobExplorerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/explore/support/JobExplorerFactoryBean.java index aa8262a6f..10cbc3ac0 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/explore/support/JobExplorerFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/explore/support/JobExplorerFactoryBean.java @@ -35,10 +35,10 @@ import org.springframework.batch.core.repository.ExecutionContextSerializer; import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao; import org.springframework.batch.core.repository.dao.DefaultExecutionContextSerializer; import org.springframework.batch.core.repository.dao.ExecutionContextDao; -import org.springframework.batch.core.repository.dao.JdbcExecutionContextDao; -import org.springframework.batch.core.repository.dao.JdbcJobExecutionDao; -import org.springframework.batch.core.repository.dao.JdbcJobInstanceDao; -import org.springframework.batch.core.repository.dao.JdbcStepExecutionDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcExecutionContextDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcJobExecutionDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcJobInstanceDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcStepExecutionDao; import org.springframework.batch.core.repository.dao.JobExecutionDao; import org.springframework.batch.core.repository.dao.JobInstanceDao; import org.springframework.batch.core.repository.dao.StepExecutionDao; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/explore/support/MongoJobExplorerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/explore/support/MongoJobExplorerFactoryBean.java index 9b39693ce..053147ff7 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/explore/support/MongoJobExplorerFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/explore/support/MongoJobExplorerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,10 @@ import org.springframework.batch.core.repository.dao.ExecutionContextDao; import org.springframework.batch.core.repository.dao.JobExecutionDao; import org.springframework.batch.core.repository.dao.JobInstanceDao; import org.springframework.batch.core.repository.dao.StepExecutionDao; -import org.springframework.batch.core.repository.dao.MongoExecutionContextDao; -import org.springframework.batch.core.repository.dao.MongoJobExecutionDao; -import org.springframework.batch.core.repository.dao.MongoJobInstanceDao; -import org.springframework.batch.core.repository.dao.MongoStepExecutionDao; +import org.springframework.batch.core.repository.dao.mongodb.MongoExecutionContextDao; +import org.springframework.batch.core.repository.dao.mongodb.MongoJobExecutionDao; +import org.springframework.batch.core.repository.dao.mongodb.MongoJobInstanceDao; +import org.springframework.batch.core.repository.dao.mongodb.MongoStepExecutionDao; import org.springframework.beans.factory.InitializingBean; import org.springframework.data.mongodb.core.MongoOperations; import org.springframework.data.mongodb.core.convert.MappingMongoConverter; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/JdbcJobRepositoryFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/JdbcJobRepositoryFactoryBean.java index 5250f2392..5267951b2 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/JdbcJobRepositoryFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/JdbcJobRepositoryFactoryBean.java @@ -18,9 +18,9 @@ package org.springframework.batch.core.repository.support; import org.springframework.batch.core.repository.ExecutionContextSerializer; import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao; import org.springframework.batch.core.repository.dao.DefaultExecutionContextSerializer; -import org.springframework.batch.core.repository.dao.JdbcExecutionContextDao; -import org.springframework.batch.core.repository.dao.JdbcJobExecutionDao; -import org.springframework.batch.core.repository.dao.JdbcStepExecutionDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcExecutionContextDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcJobExecutionDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcStepExecutionDao; import org.springframework.batch.item.database.support.DataFieldMaxValueIncrementerFactory; import org.springframework.batch.item.database.support.DefaultDataFieldMaxValueIncrementerFactory; import org.springframework.beans.factory.FactoryBean; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/JobRepositoryFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/JobRepositoryFactoryBean.java index 92781dfd6..a1cc3d904 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/JobRepositoryFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/JobRepositoryFactoryBean.java @@ -28,6 +28,10 @@ import org.springframework.batch.core.converter.StringToLocalDateTimeConverter; import org.springframework.batch.core.converter.StringToLocalTimeConverter; import org.springframework.batch.core.repository.ExecutionContextSerializer; import org.springframework.batch.core.repository.dao.*; +import org.springframework.batch.core.repository.dao.jdbc.JdbcExecutionContextDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcJobExecutionDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcJobInstanceDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcStepExecutionDao; import org.springframework.batch.item.database.support.DataFieldMaxValueIncrementerFactory; import org.springframework.batch.item.database.support.DefaultDataFieldMaxValueIncrementerFactory; import org.springframework.batch.support.DatabaseType; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MongoJobRepositoryFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MongoJobRepositoryFactoryBean.java index f679d50a3..0cebd2259 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MongoJobRepositoryFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MongoJobRepositoryFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,10 @@ import org.springframework.batch.core.repository.dao.ExecutionContextDao; import org.springframework.batch.core.repository.dao.JobExecutionDao; import org.springframework.batch.core.repository.dao.JobInstanceDao; import org.springframework.batch.core.repository.dao.StepExecutionDao; -import org.springframework.batch.core.repository.dao.MongoExecutionContextDao; -import org.springframework.batch.core.repository.dao.MongoJobExecutionDao; -import org.springframework.batch.core.repository.dao.MongoJobInstanceDao; -import org.springframework.batch.core.repository.dao.MongoStepExecutionDao; +import org.springframework.batch.core.repository.dao.mongodb.MongoExecutionContextDao; +import org.springframework.batch.core.repository.dao.mongodb.MongoJobExecutionDao; +import org.springframework.batch.core.repository.dao.mongodb.MongoJobInstanceDao; +import org.springframework.batch.core.repository.dao.mongodb.MongoStepExecutionDao; import org.springframework.beans.factory.InitializingBean; import org.springframework.data.mongodb.core.MongoOperations; import org.springframework.data.mongodb.core.convert.MappingMongoConverter; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/BatchRegistrarTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/BatchRegistrarTests.java index 085b0714a..453ca766c 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/BatchRegistrarTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/annotation/BatchRegistrarTests.java @@ -34,11 +34,10 @@ import org.springframework.batch.core.converter.JsonJobParametersConverter; import org.springframework.batch.core.launch.JobLauncher; import org.springframework.batch.core.launch.JobOperator; import org.springframework.batch.core.repository.JobRepository; -import org.springframework.batch.core.repository.dao.JdbcExecutionContextDao; -import org.springframework.batch.core.repository.dao.JdbcJobExecutionDao; -import org.springframework.batch.core.repository.dao.JdbcJobInstanceDao; -import org.springframework.batch.core.repository.dao.JdbcStepExecutionDao; -import org.springframework.beans.factory.BeanCreationException; +import org.springframework.batch.core.repository.dao.jdbc.JdbcExecutionContextDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcJobExecutionDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcJobInstanceDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcStepExecutionDao; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/launch/JobLauncherIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/launch/JobLauncherIntegrationTests.java index 2111ebc35..b062d4f31 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/launch/JobLauncherIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/launch/JobLauncherIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import org.springframework.batch.core.Job; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParametersBuilder; -import org.springframework.batch.core.repository.dao.JdbcJobExecutionDao; +import org.springframework.batch.core.repository.dao.jdbc.JdbcJobExecutionDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractJobExecutionDaoTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractJobExecutionDaoTests.java index 2ebbee0fa..99fe5d84c 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractJobExecutionDaoTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractJobExecutionDaoTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2023 the original author or authors. + * Copyright 2008-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobInstance; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.StepExecution; +import org.springframework.batch.core.repository.dao.jdbc.JdbcJobExecutionDao; import org.springframework.dao.OptimisticLockingFailureException; import org.springframework.transaction.annotation.Transactional; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/CustomJobKeyGenerator.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/CustomJobKeyGenerator.java new file mode 100644 index 000000000..495e9a205 --- /dev/null +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/CustomJobKeyGenerator.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.batch.core.repository.dao.jdbc; + +import org.jetbrains.annotations.NotNull; +import org.springframework.batch.core.JobKeyGenerator; + +public class CustomJobKeyGenerator implements JobKeyGenerator { + + @Override + public @NotNull String generateKey(@NotNull String source) { + return "1"; + } + +} \ No newline at end of file diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDaoTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcExecutionContextDaoTests.java similarity index 91% rename from spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDaoTests.java rename to spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcExecutionContextDaoTests.java index b7f69611b..c0b8404b1 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDaoTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcExecutionContextDaoTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2022 the original author or authors. + * Copyright 2008-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.jdbc; import org.junit.jupiter.api.Test; -import org.springframework.jdbc.core.JdbcOperations; +import org.springframework.batch.core.repository.dao.*; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobDaoQueryTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobDaoQueryTests.java similarity index 95% rename from spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobDaoQueryTests.java rename to spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobDaoQueryTests.java index 38ae4477e..f2edf2e53 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobDaoQueryTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobDaoQueryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.jdbc; import java.util.ArrayList; import java.util.List; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobDaoTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobDaoTests.java similarity index 89% rename from spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobDaoTests.java rename to spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobDaoTests.java index f7ad628d3..34b7b3ea2 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobDaoTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobDaoTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2022 the original author or authors. + * Copyright 2008-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.jdbc; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -24,6 +24,8 @@ import java.util.Map; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.batch.core.ExitStatus; +import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao; +import org.springframework.batch.core.repository.dao.AbstractJobDaoTests; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; import org.springframework.transaction.annotation.Transactional; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDaoTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobExecutionDaoTests.java similarity index 92% rename from spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDaoTests.java rename to spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobExecutionDaoTests.java index 67ceaeb5e..7c42611c7 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDaoTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobExecutionDaoTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2023 the original author or authors. + * Copyright 2008-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.jdbc; import java.time.LocalDate; import java.time.LocalDateTime; @@ -31,6 +31,10 @@ import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobParameter; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParametersBuilder; +import org.springframework.batch.core.repository.dao.AbstractJobExecutionDaoTests; +import org.springframework.batch.core.repository.dao.JobExecutionDao; +import org.springframework.batch.core.repository.dao.JobInstanceDao; +import org.springframework.batch.core.repository.dao.StepExecutionDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDaoCustomTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobInstanceDaoCustomTests.java similarity index 87% rename from spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDaoCustomTests.java rename to spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobInstanceDaoCustomTests.java index 9bf44049f..d63314d95 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDaoCustomTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobInstanceDaoCustomTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2023 the original author or authors. + * Copyright 2008-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.jdbc; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.batch.core.JobKeyGenerator; +import org.springframework.batch.core.repository.dao.JobInstanceDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; @@ -49,12 +50,3 @@ public class JdbcJobInstanceDaoCustomTests { } } - -class CustomJobKeyGenerator implements JobKeyGenerator { - - @Override - public String generateKey(String source) { - return "1"; - } - -} diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDaoTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobInstanceDaoTests.java similarity index 92% rename from spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDaoTests.java rename to spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobInstanceDaoTests.java index e1a6f0dbd..63ac15486 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDaoTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobInstanceDaoTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2023 the original author or authors. + * Copyright 2008-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.jdbc; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -33,6 +33,9 @@ import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobInstance; import org.springframework.batch.core.JobKeyGenerator; import org.springframework.batch.core.JobParameters; +import org.springframework.batch.core.repository.dao.AbstractJobInstanceDaoTests; +import org.springframework.batch.core.repository.dao.JobExecutionDao; +import org.springframework.batch.core.repository.dao.JobInstanceDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDaoTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcStepExecutionDaoTests.java similarity index 92% rename from spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDaoTests.java rename to spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcStepExecutionDaoTests.java index f4651a247..00cb9d1ed 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDaoTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/jdbc/JdbcStepExecutionDaoTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2023 the original author or authors. + * Copyright 2008-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.core.repository.dao; +package org.springframework.batch.core.repository.dao.jdbc; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; @@ -23,6 +23,8 @@ import org.junit.jupiter.api.Test; import org.springframework.batch.core.ExitStatus; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.repository.JobRepository; +import org.springframework.batch.core.repository.dao.AbstractStepExecutionDaoTests; +import org.springframework.batch.core.repository.dao.StepExecutionDao; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; import org.springframework.transaction.annotation.Transactional; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/MongoExecutionContextDaoIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/MongoExecutionContextDaoIntegrationTests.java index a04795928..e124f7746 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/MongoExecutionContextDaoIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/MongoExecutionContextDaoIntegrationTests.java @@ -28,7 +28,7 @@ import org.springframework.batch.core.JobParametersBuilder; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.launch.JobLauncher; import org.springframework.batch.core.repository.dao.ExecutionContextDao; -import org.springframework.batch.core.repository.dao.MongoExecutionContextDao; +import org.springframework.batch.core.repository.dao.mongodb.MongoExecutionContextDao; import org.springframework.batch.core.repository.support.MongoExecutionContextDaoIntegrationTests.ExecutionContextDaoConfiguration; import org.springframework.batch.item.ExecutionContext; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryIntegrationTests.java index eb81dbd24..6e6891fa9 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2024 the original author or authors. + * Copyright 2008-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; * @author Dimitrios Liapis * @author Mahmoud Ben Hassine */ -@SpringJUnitConfig(locations = "/org/springframework/batch/core/repository/dao/sql-dao-test.xml") +@SpringJUnitConfig(locations = "/org/springframework/batch/core/repository/dao/jdbc/sql-dao-test.xml") class SimpleJobRepositoryIntegrationTests { @Autowired diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/AsyncChunkOrientedStepIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/AsyncChunkOrientedStepIntegrationTests.java index 323c89cd0..ef7e65533 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/AsyncChunkOrientedStepIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/AsyncChunkOrientedStepIntegrationTests.java @@ -53,7 +53,7 @@ import static org.junit.jupiter.api.Assertions.assertNotSame; * @author Mahmoud Ben Hassine * */ -@SpringJUnitConfig(locations = "/org/springframework/batch/core/repository/dao/sql-dao-test.xml") +@SpringJUnitConfig(locations = "/org/springframework/batch/core/repository/dao/jdbc/sql-dao-test.xml") class AsyncChunkOrientedStepIntegrationTests { private TaskletStep step; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/ChunkOrientedStepIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/ChunkOrientedStepIntegrationTests.java index 07d5b9448..ce8f2861d 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/ChunkOrientedStepIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/tasklet/ChunkOrientedStepIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ import static org.junit.jupiter.api.Assertions.assertNotSame; * @author Dave Syer * */ -@SpringJUnitConfig(locations = "/org/springframework/batch/core/repository/dao/sql-dao-test.xml") +@SpringJUnitConfig(locations = "/org/springframework/batch/core/repository/dao/jdbc/sql-dao-test.xml") class ChunkOrientedStepIntegrationTests { private TaskletStep step; diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/sql-dao-custom-key-generator-test.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/jdbc/sql-dao-custom-key-generator-test.xml similarity index 93% rename from spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/sql-dao-custom-key-generator-test.xml rename to spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/jdbc/sql-dao-custom-key-generator-test.xml index d6c30b837..ba4b6affe 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/sql-dao-custom-key-generator-test.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/jdbc/sql-dao-custom-key-generator-test.xml @@ -26,25 +26,25 @@ - + - + - + - + - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/sql-dao-test.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/jdbc/sql-dao-test.xml similarity index 94% rename from spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/sql-dao-test.xml rename to spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/jdbc/sql-dao-test.xml index a219d0902..be15bdee5 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/sql-dao-test.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/dao/jdbc/sql-dao-test.xml @@ -26,12 +26,12 @@ - + - + @@ -42,7 +42,7 @@ - + @@ -53,7 +53,7 @@ - +