Announcement Announcement Module
Collapse
No announcement yet.
Custom Query with JpaPagingItemReader Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom Query with JpaPagingItemReader

    Hi,

    Is it possible to create a custom query with JpaPagingItemReader where I am including a group by clause and selecting only a subset of the fields from my JPA entity, something like this...


    Code:
    <bean id="DetailsDataLoader"	class="org.springframework.batch.item.database.JpaPagingItemReader"	scope="step">
    		<property name="entityManagerFactory" ref="ISentityManagerFactory" />
    		<property name="queryString">
    			<value>
    <![CDATA[
    select s. networkCompanyId, s. settlementEntity, s. dateSettlement, s. adviceComponentCode, s. productGroup,
    s. productId, sum (grossAmountUsd),sum (grossAmountStl) from SettlementDetail s where s. dateSettlement <= '#{jobParameters[processDate]}' and s. adviceDate is null
    group by s. networkCompanyId, s. settlementEntity, s. dateSettlement
    >
    
    </value>
    		</property>
    Thanks in advance for any help.
Working...
X