Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<bean id="TestCompositeWriter"
class="org.springframework.batch.item.support.CompositeItemWriter"
scope="step">
<property name="delegates">
<list>
<ref bean="TestWriter1"/>
<ref bean="TestWriter2"/>
</list>
</property>
</bean>
<bean id="TestWriter1"
class="org.springframework.batch.item.database.JdbcBatchItemWriter"
scope="step">
<property name="assertUpdates" value="true" />
<property name="itemSqlParameterSourceProvider">
<bean class="org.springframework.batch.item.database.BeanPropertyItemSqlParameterSourceProvider" />
</property>
<property name="sql"
value="INSERT INTO TB_TARGET1(NEW_COL1, NEW_COL2)
VALUES(:newCol1, :newCol2)"
/>
<property name="dataSource" ref="testDataSource" />
</bean>
<bean id="TestWriter2"
class="org.springframework.batch.item.database.JdbcBatchItemWriter"
scope="step">
<property name="assertUpdates" value="true" />
<property name="itemSqlParameterSourceProvider">
<bean class="org.springframework.batch.item.database.BeanPropertyItemSqlParameterSourceProvider" />
</property>
<property name="sql"
value="INSERT INTO TB_TARGET2(NEW_COL1, NEW_COL3)
VALUES(:newCol1, :newCol3)"
/>
<property name="dataSource" ref="testDataSource" />
</bean>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment