spring-projects / spring-batch-extensions

Spring Batch Extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

startStatement() should not be required in Neo4jItemReader

hadiyarajesh opened this issue · comments

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.

Neo4jItemReader was deprecated v5.0 in favor of the item reader from https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-neo4j. I will transfer this issue to the tracker of the extensions repository.