spring-projects / spring-projects/spring-batch-extensions
startStatement() should not be required in Neo4jItemReader
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 277
- Forks
- 269
- PR merge metrics
- No merged PRs in 30d
Description
Bug description
In Neo4jItemReaderBuilder, startStatement(String startStatement) is required, but Neo4j itself deprecated the START statement and throw error when used. If not used, application will throw BeanCreationException with message java.lang.IllegalArgumentException: startStatement is required.
Environment
Spring Boot: 2.7.0
Kotlin: 1.6.10
Neo4j: 4.4.4
Steps to reproduce
@Bean
fun postReader(): ItemReader<Post> {
return Neo4jItemReaderBuilder<Post>()
.name("postReader")
.sessionFactory(getSessionFactory())
.startStatement("")
.matchStatement("(p:Post)")
.returnStatement("p")
.targetType(Post::class.java)
.pageSize(1000)
.build()
}
Expected behavior
startStatement() should be optional, not mandatory.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating Neo4jItemReaderBuilder and read the validation around startStatement(String startStatement), then inspect any related builder tests. Reproduce the BeanCreationException with the shown configuration and verify that omitting startStatement allows the reader to build while matchStatement and returnStatement still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kotlin, spring
- Domain
- database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100