Hi,
I have a simple job where I want to read from one database and write to another, and I want to use JPA to do this. Here is my config..
My doubt is how do I tell JpaItemWriter which table and columns to write to? JpaPagingItemReader has a queryString property to specify the table and columns to read from, but JpaItemWriter does not seem to have any such property?Code:<job id="loadAdviceScheduleJob" xmlns="http://www.springframework.org/schema/batch"> <step id="step1"> <tasklet transaction-manager="transactionManager"> <chunk reader="AdviceScheduleReader" writer="AdviceScheduleWriter" commit-interval="10" /> </tasklet> </step> </job> <bean id="AdviceScheduleReader" class="org.springframework.batch.item.database.JpaPagingItemReader"> <property name="entityManagerFactory" ref="entityManagerFactory" /> <property name="queryString" value="select a from Adsphy01 a" /> </bean> <bean id="AdviceScheduleWriter" class="org.springframework.batch.item.database.JpaItemWriter"> <property name="entityManagerFactory" ref="ISentityManagerFactory" /> </bean>
Thanks in advance for any help.


Reply With Quote