From a73fbc3cbc47c82c338669898433222f29416355 Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Mon, 17 May 2021 17:49:11 -0400 Subject: [PATCH] Add getters for DAOs in SimpleJobExplorer Resolves #1598 --- .../explore/support/SimpleJobExplorer.java | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/SimpleJobExplorer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/SimpleJobExplorer.java index 21c9f9d57e..e02d7d4a78 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/SimpleJobExplorer.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/SimpleJobExplorer.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2022 the original author or authors. + * Copyright 2006-2023 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. @@ -40,6 +40,7 @@ * @author Will Schipp * @author Mahmoud Ben Hassine * @author Parikshit Dutta + * @author Glenn Renfro * @see JobExplorer * @see JobInstanceDao * @see JobExecutionDao @@ -244,6 +245,38 @@ public long getJobInstanceCount(@Nullable String jobName) throws NoSuchJobExcept return jobInstanceDao.getJobInstanceCount(jobName); } + /** + * @return instance of {@link JobInstanceDao}. + * @since 5.1 + */ + protected JobInstanceDao getJobInstanceDao() { + return jobInstanceDao; + } + + /** + * @return instance of {@link JobExecutionDao}. + * @since 5.1 + */ + protected JobExecutionDao getJobExecutionDao() { + return jobExecutionDao; + } + + /** + * @return instance of {@link StepExecutionDao}. + * @since 5.1 + */ + protected StepExecutionDao getStepExecutionDao() { + return stepExecutionDao; + } + + /** + * @return instance of {@link ExecutionContextDao}. + * @since 5.1 + */ + protected ExecutionContextDao getEcDao() { + return ecDao; + } + /* * Find all dependencies for a JobExecution, including JobInstance (which requires * JobParameters) plus StepExecutions