Skip to content

Commit 9eafb31

Browse files
committed
Move DAOs implementations to separate packages
Resolves #4848
1 parent d6ce07b commit 9eafb31

32 files changed

+130
-82
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JdbcDefaultBatchConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
import org.springframework.batch.core.repository.JobRepository;
3131
import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao;
3232
import org.springframework.batch.core.repository.dao.DefaultExecutionContextSerializer;
33-
import org.springframework.batch.core.repository.dao.JdbcExecutionContextDao;
34-
import org.springframework.batch.core.repository.dao.JdbcJobExecutionDao;
35-
import org.springframework.batch.core.repository.dao.JdbcStepExecutionDao;
33+
import org.springframework.batch.core.repository.dao.jdbc.JdbcExecutionContextDao;
34+
import org.springframework.batch.core.repository.dao.jdbc.JdbcJobExecutionDao;
35+
import org.springframework.batch.core.repository.dao.jdbc.JdbcStepExecutionDao;
3636
import org.springframework.batch.core.repository.support.JdbcJobRepositoryFactoryBean;
3737
import org.springframework.batch.item.database.support.DataFieldMaxValueIncrementerFactory;
3838
import org.springframework.batch.item.database.support.DefaultDataFieldMaxValueIncrementerFactory;
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.batch.core.repository.dao;
17+
package org.springframework.batch.core.repository.dao.jdbc;
1818

1919
import java.io.ByteArrayInputStream;
2020
import java.io.ByteArrayOutputStream;
@@ -36,6 +36,9 @@
3636
import org.springframework.batch.core.JobExecution;
3737
import org.springframework.batch.core.StepExecution;
3838
import org.springframework.batch.core.repository.ExecutionContextSerializer;
39+
import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao;
40+
import org.springframework.batch.core.repository.dao.DefaultExecutionContextSerializer;
41+
import org.springframework.batch.core.repository.dao.ExecutionContextDao;
3942
import org.springframework.batch.item.ExecutionContext;
4043
import org.springframework.core.serializer.Serializer;
4144
import org.springframework.jdbc.core.BatchPreparedStatementSetter;

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java renamed to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobExecutionDao.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2023 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.batch.core.repository.dao;
17+
package org.springframework.batch.core.repository.dao.jdbc;
1818

1919
import java.sql.PreparedStatement;
2020
import java.sql.ResultSet;
@@ -46,6 +46,9 @@
4646
import org.springframework.batch.core.converter.StringToLocalDateConverter;
4747
import org.springframework.batch.core.converter.StringToLocalDateTimeConverter;
4848
import org.springframework.batch.core.converter.StringToLocalTimeConverter;
49+
import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao;
50+
import org.springframework.batch.core.repository.dao.JobExecutionDao;
51+
import org.springframework.batch.core.repository.dao.NoSuchObjectException;
4952
import org.springframework.beans.factory.InitializingBean;
5053
import org.springframework.core.convert.support.ConfigurableConversionService;
5154
import org.springframework.core.convert.support.DefaultConversionService;

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java renamed to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcJobInstanceDao.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.batch.core.repository.dao;
17+
package org.springframework.batch.core.repository.dao.jdbc;
1818

1919
import java.sql.ResultSet;
2020
import java.sql.SQLException;
@@ -28,6 +28,8 @@
2828
import org.springframework.batch.core.JobKeyGenerator;
2929
import org.springframework.batch.core.JobParameters;
3030
import org.springframework.batch.core.launch.NoSuchJobException;
31+
import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao;
32+
import org.springframework.batch.core.repository.dao.JobInstanceDao;
3133
import org.springframework.beans.factory.InitializingBean;
3234
import org.springframework.dao.DataAccessException;
3335
import org.springframework.dao.EmptyResultDataAccessException;

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java renamed to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/jdbc/JdbcStepExecutionDao.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2024 the original author or authors.
2+
* Copyright 2006-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.batch.core.repository.dao;
17+
package org.springframework.batch.core.repository.dao.jdbc;
1818

1919
import java.sql.PreparedStatement;
2020
import java.sql.ResultSet;
@@ -38,6 +38,8 @@
3838
import org.springframework.batch.core.JobExecution;
3939
import org.springframework.batch.core.JobInstance;
4040
import org.springframework.batch.core.StepExecution;
41+
import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao;
42+
import org.springframework.batch.core.repository.dao.StepExecutionDao;
4143
import org.springframework.beans.factory.InitializingBean;
4244
import org.springframework.dao.OptimisticLockingFailureException;
4345
import org.springframework.jdbc.core.BatchPreparedStatementSetter;

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoExecutionContextDao.java renamed to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoExecutionContextDao.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 the original author or authors.
2+
* Copyright 2024-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,12 +13,13 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.batch.core.repository.dao;
16+
package org.springframework.batch.core.repository.dao.mongodb;
1717

1818
import java.util.Collection;
1919

2020
import org.springframework.batch.core.JobExecution;
2121
import org.springframework.batch.core.StepExecution;
22+
import org.springframework.batch.core.repository.dao.ExecutionContextDao;
2223
import org.springframework.batch.item.ExecutionContext;
2324
import org.springframework.data.mongodb.core.MongoOperations;
2425
import org.springframework.data.mongodb.core.query.Query;

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoJobExecutionDao.java renamed to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoJobExecutionDao.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.batch.core.repository.dao;
16+
package org.springframework.batch.core.repository.dao.mongodb;
1717

1818
import java.util.HashSet;
1919
import java.util.List;
2020
import java.util.Set;
2121

2222
import org.springframework.batch.core.JobExecution;
2323
import org.springframework.batch.core.JobInstance;
24+
import org.springframework.batch.core.repository.dao.JobExecutionDao;
2425
import org.springframework.batch.core.repository.persistence.converter.JobExecutionConverter;
2526
import org.springframework.batch.core.repository.persistence.converter.JobInstanceConverter;
2627
import org.springframework.data.domain.Sort;

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoJobInstanceDao.java renamed to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoJobInstanceDao.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.batch.core.repository.dao;
16+
package org.springframework.batch.core.repository.dao.mongodb;
1717

1818
import java.util.List;
1919

@@ -23,8 +23,8 @@
2323
import org.springframework.batch.core.JobKeyGenerator;
2424
import org.springframework.batch.core.JobParameters;
2525
import org.springframework.batch.core.launch.NoSuchJobException;
26+
import org.springframework.batch.core.repository.dao.JobInstanceDao;
2627
import org.springframework.batch.core.repository.persistence.converter.JobInstanceConverter;
27-
import org.springframework.data.domain.Example;
2828
import org.springframework.data.domain.Sort;
2929
import org.springframework.data.mongodb.core.MongoOperations;
3030
import org.springframework.data.mongodb.core.query.Query;

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoSequenceIncrementer.java renamed to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoSequenceIncrementer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 the original author or authors.
2+
* Copyright 2024-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.batch.core.repository.dao;
16+
package org.springframework.batch.core.repository.dao.mongodb;
1717

1818
import com.mongodb.client.model.FindOneAndUpdateOptions;
1919
import com.mongodb.client.model.ReturnDocument;

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoStepExecutionDao.java renamed to spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/mongodb/MongoStepExecutionDao.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 the original author or authors.
2+
* Copyright 2024-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.batch.core.repository.dao;
16+
package org.springframework.batch.core.repository.dao.mongodb;
1717

1818
import java.util.ArrayList;
1919
import java.util.Collection;
@@ -24,6 +24,7 @@
2424
import org.springframework.batch.core.JobExecution;
2525
import org.springframework.batch.core.JobInstance;
2626
import org.springframework.batch.core.StepExecution;
27+
import org.springframework.batch.core.repository.dao.StepExecutionDao;
2728
import org.springframework.batch.core.repository.persistence.converter.JobExecutionConverter;
2829
import org.springframework.batch.core.repository.persistence.converter.StepExecutionConverter;
2930
import org.springframework.data.mongodb.core.MongoOperations;

0 commit comments

Comments
 (0)