热卖商品
新闻详情
mybatis spring mvc application,获取无效的绑定语句(未找到...
来自 : www.voidcn.com/article/p-mdhbh
发布时间:2021-03-25
这是我使用spring 3.2.4,mybatis-spring-1.2.1的第一个mybatis spring mvc应用程序
当我尝试调用我的webservice时,我收到错误::
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.mydomain.formulary.drugmaster.dao.DrugMasterDao.getDrugsWithAlert
我必须遗漏一些明显的东西.
谢谢你的帮助
这是我的相关文件:
applicationContext.xml中
bean id=\"sqlSessionFactory\" property name=\"dataSource\" ref=\"formularyDb\" / property name=\"configLocation\" value=\"file:/web/sites/drugformulary-spring/config/mybatis-config.xml\" / /bean bean property name=\"basePackage\" value=\"org.mydomain.formulary.mappers\" / /bean bean id=\"DrugMasterDao\" property name=\"mapperInterface\" value=\"org.mydomain.formulary.drugmaster.dao.DrugMasterDao\" / property name=\"sqlSessionFactory\" ref=\"sqlSessionFactory\" / /bean bean id=\"sqlSession\" constructor-arg index=\"0\" ref=\"sqlSessionFactory\" / /bean
映射文件 – /classes/org/mydomain/formulary/mappers/drugmasterDao.xml
mapper namespace=\"org.mydomain.formulary.drugmaster.dao.DrugMasterDao\" select id=\"getDrugsWithAlert\" parameterType=\"int\" resultType=\"org.mydomain.formulary.drug_master.model.DrugMasters\" Select drug_id,drug_name,drug_alert_date,drug_alert_source, rownum from (select drug_id,drug_name,to_char(drug_alert_datetime,\'MM/DD/YYYY\') as drug_alert_date ,drug_alert_source, rownum from drug_master where drug_status =\'A\' and length(drug_alert) 0 order by drug_alert_datetime DESC ) where if test=\"_parameter != null\" rownum #{count} /if /select /mapper
映射文件 – /classes/org/mydomain/formulary/drugmaster/dao/DrugMasterDao.java
public interface DrugMasterDao { public List DrugMasters getDrugsWithAlert(int count);}
控制器文件 – /classes/org/mydomain/formulary/drugmaster/controller/DrugMasterController.java
@Controllerpublic class DrugMasterController {@AutowiredDrugMasterService drugMasterService;
本文链接: http://drugmasters.immuno-online.com/view-735029.html
发布于 : 2021-03-25
阅读(0)
最新动态
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25