this is my batis generator file:

<table tableName="jxc_stock_journal" enableCountByExample="true" enableSelectByPrimaryKey="true" enableSelectByExample="true" enableUpdateByPrimaryKey="true" enableDeleteByPrimaryKey="true" enableInsert="true" domainObjectName="JxcStockJournal"> <generatedKey column="id" sqlStatement="MySql" identity="true" /> </table> 

so it will generate the mapper xml file. with null check in updateByPrimaryKeySelective method: enter image description here

and I need to set some field to null with updateByPrimaryKeySelective, how to do it?

1

2 Answers

You need to use the "updateByPrimaryKey" method to set a null value. As you've seen, you can do that with "updateByPrimaryKeySelective".

2

use

int updateByExampleSelective(@Param("record") PriceActivityApplyDO record, @Param("example") PriceActivityApplyExample example, @Param("selective") PriceActivityApplyDO.Column ... selective); 
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.