I have a factory-method: getTickerJobQuery providing a dynamic sql input to the JdbcCursorItemReader.
How could I get hold of the jobParameters, - and provide them as input to either the JdbcCursorItemReader, - or to the getTickerJobQuery?
Or suggest another approach..
Geir
Code:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> <description>This file defines the job for the ticker process.</description> <context:component-scan base-package="no.aftenposten.accountbalancer.batch.itemwriter"/> <import resource="classpath:/springAccountBalancerCore-configurer.xml"/> <bean id="tickerSequence" parent="simpleJob"> <property name="jobRepository" ref="simpleJobRepository"/> <property name="steps"> <list> <bean id="tickerStep" parent="simpleStep"> <property name="itemReader" ref="jdbcTickerJobItemReader"/> <property name="itemWriter" ref="tickerJobItemWriter"/> <property name="commitInterval" value="1000"/> </bean> </list> </property> </bean> <bean id="tickerJobItemWriter" class="no.aftenposten.accountbalancer.batch.itemwriter.TickerJobItemWriter"> <property name="accountingManager" ref="accountingManagerImpl"/> <property name="accountingDao" ref="accountingJdbcDao"/> <property name="productLineDao" ref="productLineHibernateDao"/> <property name="subscriptionDao" ref="subscriptionHibernateDao"/> </bean> <bean id="jdbcTickerJobItemReader" class="org.springframework.batch.item.database.JdbcCursorItemReader"> <property name="dataSource" ref="pulsDataSource"/> <property name="mapper"> <bean class="no.aftenposten.accountbalancer.batch.mapper.SubscriptionLineMapper"/> </property> <property name="sql"> <bean factory-bean="queryFactory" factory-method="getTickerJobQuery"/> </property> </bean> </beans>


Reply With Quote