Results 1 to 2 of 2

Thread: JpaPagingItemReader queryString issue -"is null"

  1. #1

    Default JpaPagingItemReader queryString issue -"is null"

    Hi,

    We are facing a "strange" problem regarding the use of "is null" in the JPQL queryString of the JpaPagingItemReader.
    Apparently the query result is not retrieving all data from the table that has a null value in the table column (that is serving as filter in the query).

    Code from job.xml
    "
    ....

    <bean id="cursorReader"
    class="org.springframework.batch.item.database.Jpa PagingItemReader" scope="step">
    <property name="entityManagerFactory" ref="entityManagerFactoryEclipseLink" />
    <property name="queryString" value="select c from FornecedorEntity c where c.nuc is null" />
    <property name="saveState" value="false" />
    </bean>

    "


    If we change the null values to zero in the database and change the JpaPagingItemReader queryString to "=0" all apears to work well. The query result retrieves all the data that as zero value in that table field.

    Code from the changed job.xml
    "
    ....

    <bean id="cursorReader"
    class="org.springframework.batch.item.database.Jpa PagingItemReader" scope="step">
    <property name="entityManagerFactory" ref="entityManagerFactoryEclipseLink" />
    <property name="queryString" value="select c from FornecedorEntity c where c.nuc = 0" />
    <property name="saveState" value="false" />
    </bean>

    "

    The problem is that we canno't change the null values to zero, because the table is not ours, and we canno't be sure that the job process all the data that he should process.

    Does anyone have a clue what's happening here ?

  2. #2

    Default

    Ok,

    We figure it out.
    The was due to pagination (Oracle) and updating the same column in the queryString filter.

    Case closed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •