設置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);



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