日期:2014-05-20  浏览次数:20700 次

Ibatis查询为空
SQL
XML code

    <!-- 根据code检测记录是否存在 -->
    <select id="checkByCode" parameterClass="java.lang.String" resultClass="int">
      select  count(1) from class  t where t.code=#code# and t.flag=1
    </select>


DAO
XML code

    /**
     *根据code查询记录是否存在
     *
     *@param  String
     *@return boolean
     * */
    public boolean checkIsExistByCode(String code);



DAOImpl
Java code

    /**
     *根据code查询记录是否存在
     *
     *@param  String
     *@return boolean
     * */
    public boolean checkIsExistByCode(String code){
        return (Integer)sqlClient.queryForObject("checkByCode",code)==0?false:true;
    }



问题DAOImpl 报空指针sqlClient.queryForObject("checkByCode",code)查询是null
但我用后台打出来的sql和参数 在plsql中可以查到值

------解决方案--------------------
自己再调一调吧,从你给的信息业看不出什么来
------解决方案--------------------
你随便换图sql语句看看吧。。感觉实现类没问题啊。