mybatis之The expression 'oredCriteria' evaluated to a null value的解决方法


<if test="example!= null">
      <include refid="Example_Where_Clause" />
</if>
原因:执行过程中,显示在使用example的时候,里面的criteria为null;将上面的XML用下面替换
<if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
</if>

例子:

<select id="selectByExampleLimit" resultMap="BaseResultMap">
        select
        <if test="distinct">
            distinct
        </if>
        <include refid="Base_Column_List" />
        from Test
        <if test="_parameter != null" >
            <include refid="Update_By_Example_Where_Clause" />
        </if>
        <if test="orderByClause != null">
            order by ${orderByClause}
        </if>
</select>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM