Hello Simeo,
Please post code in text instead of image.
If the code is in an image, we have to type everything manually instead of copy and modify.
Plain text is just fine, but if you want syntax-coloring, try markdown-here.
https://markdown-here.com/
Anyway, you can pass multiple parameters to a statement.
Use @Param
annotation to name each parameter.
int updateDocument(
@Param("document") Document,
@Param("newId") Integer newId);
The statement would look like the following.
In this case, the correct parameterType
is map
, but it’s unnecessary.
<update id="updateDocument">
UPDATE myschema.documents
<set>
<if test="newId != null">
identitat = #{newId}
</if>
<if test="document.textDocument != null">
textdocument = #{document.textDocument}
</if>
...
<resultMap>
is irrelevant here because it is used only when mapping query results.
Regards,
Iwao
--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/CAJJNRpM6h4aXL%3DYO_5v%2Ba8k-%2Bn-xWa_wwv3jcsTe3LjGP8r%3DSQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/CA%2Buep2SE2GvMTWuLuYEzEmAKB-ZL_-yCPmWwf_EcMOaVw7sJHw%40mail.gmail.com.