spring-batch icon indicating copy to clipboard operation
spring-batch copied to clipboard

startStatement() should not be required in Neo4jItemReader

Open hadiyarajesh opened this issue 3 years ago • 0 comments
trafficstars

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.

hadiyarajesh avatar May 24 '22 09:05 hadiyarajesh