mybatis / mybatis/spring

Is it possible to add Sqlsessiontemplate function in Spring Batch

Open
#488 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting for feedback
Dominant language
Java
Stars
2.9k
Forks
2.6k
Avg merge
3d 4m
Merged PRs (30d)
8

Description

Now only this way:
MyBatisCursorItemReader reader = new MyBatisCursorItemReader();
reader.setSqlSessionFactory(sqlSessionFactory);
reader.setQueryId("xxx.xxx.xxxx.xxxxxxx.mapper.BatchMstEmployeesEntityMapper.exmapleSelect");
reader.setParameterValues(map);
return reader;

Can it be used like in Spring Boot:
BatchTaskEntityExample selectExample = new BatchTaskEntityExample();
BatchTaskEntityExample.Criteria selectCriteria = selectExample1.createCriteria();
selectCriteria.andTaskStatusEqualTo("processing");
selectCriteria.andStartTimeLessThan(maxTime);
List batchs = batchTaskEntityMapper.selectByExample(selectExample);

Thanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the issue's MyBatisCursorItemReader example and the requested Spring Batch usage through a mapper and SqlSessionTemplate. Compare the existing SqlSessionFactory, queryId, and parameter-based reader setup with the proposed mapper call, then determine the supported API and expected integration behavior before defining completion criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.