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