@Override public JobExecution getLastJobExecution(JobInstance jobInstance) { Long id = jobInstance.getId(); List<JobExecution> executions = getJdbcTemplate().query(getQuery(GET_LAST_EXECUTION), new JobExecutionRowMapper(jobInstance), id, id); Assert.state(executions.size() <= 1, "There must be at most one latest job execution"); if (executions.isEmpty()) { return null; } else { return executions.get(0); } }
@Override public void processRow(ResultSet rs) throws SQLException { JobExecutionRowMapper mapper = new JobExecutionRowMapper(); result.add(mapper.mapRow(rs, 0)); } };
@Override public JobExecution getLastJobExecution(JobInstance jobInstance) { Long id = jobInstance.getId(); List<JobExecution> executions = getJdbcTemplate().query(getQuery(GET_LAST_EXECUTION), new JobExecutionRowMapper(jobInstance), id, id); Assert.state(executions.size() <= 1, "There must be at most one latest job execution"); if (executions.isEmpty()) { return null; } else { return executions.get(0); } }
@Override public JobExecution getLastJobExecution(JobInstance jobInstance) { Long id = jobInstance.getId(); List<JobExecution> executions = getJdbcTemplate().query(getQuery(GET_LAST_EXECUTION), new JobExecutionRowMapper(jobInstance), id, id); Assert.state(executions.size() <= 1, "There must be at most one latest job execution"); if (executions.isEmpty()) { return null; } else { return executions.get(0); } }
@Override public JobExecution getJobExecution(Long executionId) { try { JobExecution jobExecution = getJdbcTemplate().queryForObject(getQuery(GET_EXECUTION_BY_ID), new JobExecutionRowMapper(), executionId); return jobExecution; } catch (EmptyResultDataAccessException e) { return null; } }
@Override public List<JobExecution> findJobExecutions(final JobInstance job) { Assert.notNull(job, "Job cannot be null."); Assert.notNull(job.getId(), "Job Id cannot be null."); return getJdbcTemplate().query(getQuery(FIND_JOB_EXECUTIONS), new JobExecutionRowMapper(job), job.getId()); }
public JobExecution getJobExecution(Long executionId) { try { JobExecution jobExecution = getJdbcTemplate().queryForObject(getQuery(GET_EXECUTION_BY_ID), new JobExecutionRowMapper(), executionId); return jobExecution; } catch (EmptyResultDataAccessException e) { return null; } }
public JobExecution getLastJobExecution(JobInstance jobInstance) { Long id = jobInstance.getId(); List<JobExecution> executions = getJdbcTemplate().query(getQuery(GET_LAST_EXECUTION), new JobExecutionRowMapper(jobInstance), id, id); Assert.state(executions.size() <= 1, "There must be at most one latest job execution"); if (executions.isEmpty()) { return null; } else { return executions.get(0); } }
@Override public JobExecution getLastJobExecution(JobInstance jobInstance) { Long id = jobInstance.getId(); List<JobExecution> executions = getJdbcTemplate().query(getQuery(GET_LAST_EXECUTION), new JobExecutionRowMapper(jobInstance), id, id); Assert.state(executions.size() <= 1, "There must be at most one latest job execution"); if (executions.isEmpty()) { return null; } else { return executions.get(0); } }
@Override @Nullable public JobExecution getJobExecution(Long executionId) { try { JobExecution jobExecution = getJdbcTemplate().queryForObject(getQuery(GET_EXECUTION_BY_ID), new JobExecutionRowMapper(), executionId); return jobExecution; } catch (EmptyResultDataAccessException e) { return null; } }
@Override public List<JobExecution> findJobExecutions(final JobInstance job) { Assert.notNull(job, "Job cannot be null."); Assert.notNull(job.getId(), "Job Id cannot be null."); return getJdbcTemplate().query(getQuery(FIND_JOB_EXECUTIONS), new JobExecutionRowMapper(job), job.getId()); }
@Override @Nullable public JobExecution getJobExecution(Long executionId) { try { JobExecution jobExecution = getJdbcTemplate().queryForObject(getQuery(GET_EXECUTION_BY_ID), new JobExecutionRowMapper(), executionId); return jobExecution; } catch (EmptyResultDataAccessException e) { return null; } }
@Override public void processRow(ResultSet rs) throws SQLException { JobExecutionRowMapper mapper = new JobExecutionRowMapper(); result.add(mapper.mapRow(rs, 0)); } };
public void processRow(ResultSet rs) throws SQLException { JobExecutionRowMapper mapper = new JobExecutionRowMapper(); result.add(mapper.mapRow(rs, 0)); } };
public List<JobExecution> findJobExecutions(final JobInstance job) { Assert.notNull(job, "Job cannot be null."); Assert.notNull(job.getId(), "Job Id cannot be null."); return getJdbcTemplate().query(getQuery(FIND_JOB_EXECUTIONS), new JobExecutionRowMapper(job), job.getId()); }
@Override public List<JobExecution> findJobExecutions(final JobInstance job) { Assert.notNull(job, "Job cannot be null."); Assert.notNull(job.getId(), "Job Id cannot be null."); return getJdbcTemplate().query(getQuery(FIND_JOB_EXECUTIONS), new JobExecutionRowMapper(job), job.getId()); }
@Override public void processRow(ResultSet rs) throws SQLException { JobExecutionRowMapper mapper = new JobExecutionRowMapper(); result.add(mapper.mapRow(rs, 0)); } };
@Override public void processRow(ResultSet rs) throws SQLException { JobExecutionRowMapper mapper = new JobExecutionRowMapper(); result.add(mapper.mapRow(rs, 0)); } };
@Override @Nullable public JobExecution getJobExecution(Long executionId) { try { JobExecution jobExecution = getJdbcTemplate().queryForObject(getQuery(GET_EXECUTION_BY_ID), new JobExecutionRowMapper(), executionId); return jobExecution; } catch (EmptyResultDataAccessException e) { return null; } }
@Override public List<JobExecution> findJobExecutions(final JobInstance job) { Assert.notNull(job, "Job cannot be null."); Assert.notNull(job.getId(), "Job Id cannot be null."); return getJdbcTemplate().query(getQuery(FIND_JOB_EXECUTIONS), new JobExecutionRowMapper(job), job.getId()); }