Announcement Announcement Module
Collapse
No announcement yet.
JpaPagingItemReader queryString issue -"is null" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Ok,

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

    Case closed

    Comment

    Working...
    X