insertSelective usage

int insert(T record);
int insertSelective(T record);

insertSelective Corresponding SQL statement joined the NULL test, it will only insert the data is not null field, and  insertwill be inserted in all fields, inserts null data.

Which means if you define a table default fields, use the insert or inserts null and ignore the default

insertSelective When the field is automatically filled with the default is null

Guess you like

Origin www.cnblogs.com/hinux/p/11165977.html