JdbcBatchItemWriter中的更新语句

Shu*_*wal 5 sql spring-jdbc spring-batch

我无法使用JdbcBatchItemWriter正确更新数据库表。下面是代码片段。在空表上插入将获得正确的响应,但输入表上未发生更新。

<bean id="odbWriter" class="org.springframework.batch.item.database.JdbcBatchItemWriter">
    <property name="dataSource" ref="dataSource"></property>
    <property name="sql">
        <value>
            <![CDATA[
                update employeethree set salary = :salary, designation = :designation, promotioneligibility = :promotionEligibility 
            ]]>
        </value>
    </property>

    <property name="itemSqlParameterSourceProvider">
    <bean
    class="batchjobreaddb.CustomBeanPropertyItemSqlParameterSourceProvider" />
    </property>
Run Code Online (Sandbox Code Playgroud)

如果我将CDATA内的查询更改为:

insert into employeetwo values(:empId, :empName, :dept , :salary, :designation, :experienceInMonths, :promotionEligibility)
Run Code Online (Sandbox Code Playgroud)

那就给了我想要的结果。(EmployeeTwo具有相同的结构,但为空。)

请帮忙。谢谢 :)