设置ibatis中命名空间属性为true,才能使用!

1.首先在sql-map-conf.xml文件中设置

               <settings useStatementNamespaces="true" /> //这个很关键,我就是没有加,sql语句不能执行

                                                                                         // there is no map named selectByLoginPwToken  !!!!!!!!

2.在Account.xml使用命名空间

   <sqlMap namespace="Account">

   </sqlMap>

3.在dao中执行sql语句要加上命名空间

   (Account) this.getSqlMapClientTemplate().
        queryForObject("Account.selectByLoginPwToken", token);



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章