ibatis 的 This SQL map does not contain a MappedStatement的错误
This SQL map does not contain a MappedStatement named List
說明: 執行當前 Web 請求期間,出現未處理的異常。請檢查堆棧跟蹤信息,以了解有關該錯誤以及代碼中導致錯誤的出處的詳細信息。
異常詳細信息: IBatisNet.DataMapper.Exceptions.DataMapperException: This SQL map does not contain a MappedStatement named Adminf.List
被這個錯誤搞了幾天,反復檢查配置文件和xml文件,就是沒檢查出錯誤來,后來注意到sql的配置文件有個名字空間的,<sqlMap namespace="Admin" xmlns="http://ibatis.apache.org/mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
例如我這里是Admin,于是應用的時候我把這句:return Mapper().QueryForList("List", null);改為了return Mapper().QueryForList("Admin.List", null);? 居然可以了,沒錯誤了,可以看一些demo程序,它們都不需要這些寫啊,到現在也搞不清楚怎么回事,知情者請告訴我一下,謝謝了!
(2007-3-6)現在弄明白了,原來在sqlmap.config文件里面,我設置了useStatementNamespaces =”true”,默認也是true的,就是說使用了Satement命名空間,所以應用的時候必須加上命名空間,這樣也好,因為每個表都有select,update等操作,這樣好區分,而很多demo例子都是只操作一個表,沒有特別指出這樣的情況,所以才造成自己這樣的錯誤
轉載于:https://www.cnblogs.com/joelbh/archive/2007/03/01/660811.html
總結
以上是生活随笔為你收集整理的ibatis 的 This SQL map does not contain a MappedStatement的错误的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [导入]MsAjax Lib- Bool
- 下一篇: 在伦敦工作生活—随笔-1