下列update元素的代码<p>&lt;set&gt;</p><p>           &lt;if test="bName

分类: SSM第四单元 发布时间: 2024-01-21 00:38 浏览量: 0

下列update元素的代码

<set>

           <if test="bName != null "> bName=#{bName} ,</if>

           <if test="bAuthor != null "> bAuthor=#{bAuthor} ,</if>

    </set>

    where bId = #{bId}

    可以变换成()?

A.

<trim prefix="SET" suffixOverrides=",">

     <if test="bName != null "> bName=#{bName} ,</if>

    <if test="bAuthor != null "> bAuthor=#{bAuthor} ,</if>

</trim>

B.

<trim prefix="SET" suffix="WHERE bId = #{bId}">

      <if test="bName != null "> bName=#{bName} ,</if>

      <if test="bAuthor != null "> bAuthor=#{bAuthor} ,</if>

</trim>

C.

<trim prefix="SET" suffixOverrides="," suffix="WHERE bId = #{bId}">

      <if test="bName != null "> bName=#{bName} ,</if>

     <if test="bAuthor != null "> bAuthor=#{bAuthor} ,</if>

</trim>

D.

<trim suffixOverrides="," suffix="WHERE bId = #{bId}">

     <if test="bName != null "> bName=#{bName} ,</if>

     <if test="bAuthor != null "> bAuthor=#{bAuthor} ,</if>

</trim>

正确答案是C