- script
script
For using dynamic SQL in annotated mapper class, script element can be used. For example:
- @Update({"<script>",
- "update Author",
- " <set>",
- " <if test='username != null'>username=#{username},</if>",
- " <if test='password != null'>password=#{password},</if>",
- " <if test='email != null'>email=#{email},</if>",
- " <if test='bio != null'>bio=#{bio}</if>",
- " </set>",
- "where id=#{id}",
- "</script>"})
- void updateAuthorValues(Author author);