2 insert, update and delete
2.1 insert, update 和 delete 的属性
The data modification statements insert, update and delete are very similar in their implementation:
数据变更语句 insert、update 和 delete 是很相似的:
id="insertAuthor"
parameterType="domain.blog.Author"
flushCache="true"
statementType="PREPARED"
keyProperty=""
keyColumn=""
useGeneratedKeys=""
timeout="20">
id="updateAuthor"
parameterType="domain.blog.Author"
flushCache="true"
statementType="PREPARED"
timeout="20">
id="deleteAuthor"
parameterType="domain.blog.Author"
flushCache="true"
statementType="PREPARED"
timeout="20">
id
A unique identifier in this namespace that can be used to reference this statement.
该命名空间可以被用来引用该语句的的唯一标识。
parameterType
The fully qualified class name or alias for the parameter that will be passed into this statement. This attribute is optional because MyBatis can calculate the TypeHandler to use out of the actual parameter passed to the statement. Default is unset.
传入这条语句的参数的完全限定类名或别名。这个属性是可选的,因为MyBatis 可以自己推断出传入这条语句的实参对应的 TypeHandler。默认未设置。
parameterMap
This is a deprecated approach to referencing an external parameterMap. Use inline parameter mappings and the parameterType attribute.
已废弃,用来指向外部的 parameterMap。使用行内参数映射和 parameterType 属性。
flushCache
Setting this to true will cause the 2nd level and local caches to be flushed whenever this statement is called. Default: true for insert, update and delete statements.