微科社区,轻松开发从此开始! 请登陆 免费注册

微科社区

当前位置:首页 > Java平台 > J2ME >

spring+ibatis下报错:There is no statement named selectSQ

时间:2017-01-18 03:21  浏览:努力统计中...
There is no statement named selectSQL in this SqlMap 代码如下: beans-ibatis.xml: bean id=meatOutInfoBaseDao class=com.sunraw.kunming.dao.impl.MeatOutInfoBaseDaoImpl property name=sqlMapClient ref local=client / /property /bean bean n
There is no statement named selectSQL in this SqlMap
代码如下:

beans-ibatis.xml:
<bean id="meatOutInfoBaseDao" class="com.sunraw.kunming.dao.impl.MeatOutInfoBaseDaoImpl">
<property name="sqlMapClient">
<ref local="client" />
</property>
</bean>

<bean name="meatOutInfoBaseService"
class="com.sunraw.kunming.service.impl.MeatOutInfoBaseServiceImpl">
<property name="meatOutInfoBaseDao">
<ref bean="meatOutInfoBaseDao" />
</property>
</bean>

SqlMapConfig.xml:
<sqlMapConfig>
<!--定义iBATIS自身应用信息-->
<settings cacheModelsEnabled="true" enhancementEnabled="true"
lazyLoadingEnabled="true" maxRequests="200" maxSessions="100"
maxTransactions="20" useStatementNamespaces="true" />


<sqlMap resource="User.xml" />
<sqlMap resource="MeatOutInfoBase.xml" />
<sqlMap resource="MeatOutInfoDetail.xml" />
<sqlMap resource="MeatOutInfoSendFail.xml" />
</sqlMapConfig>

MeatOutInfoBase.xml:
<sqlMap namespace="MeatOutInfoBase">

<typeAlias alias="MeatOutInfoBase" type="com.sunraw.kunming.model.MeatOutInfoBase" />

<resultMap id="SelectResult" class="MeatOutInfoBase">
<result property="tranId" column="TRAN_ID" />
<result property="butcherFacId" column="BUTCHER_FAC_ID" />
<result property="butcherFacName" column="BUTCHER_FAC_NAME" />
<result property="transantionDate" column="TRANSANTION_DATE" />
<result property="sellerId" column="SELLER_ID" />
<result property="sellerName" column="SELLER_NAME" />
<result property="buyerId" column="BUYER_ID" />
<result property="buyerName" column="BUYER_NAME" />
<result property="dest" column="DEST" />
<result property="sendState" column="SEND_STATE" />
<result property="sendFailReson" column="SEND_FAIL_RESON" />
</resultMap>

<select id="selectSQL" resultMap="SelectResult">
<![CDATA[
select
TRAN_ID,
BUTCHER_FAC_ID,
BUTCHER_FAC_NAME,
TRANSANTION_DATE,
SELLER_ID,
SELLER_NAME,
BUYER_ID,
BUYER_NAME,
DEST,
SEND_STATE,
SEND_FAIL_RESON
from meat_out_info_base
]]>
</select>
</sqlMap>

dao:
public interface MeatOutInfoBaseDao extends GenericDao<MeatOutInfoBase, String> {

}
dao.impl:
public class MeatOutInfoBaseDaoImpl extends GenericDaoImpl<MeatOutInfoBase, String> implements MeatOutInfoBaseDao {

}
service:
@WebService
public interface MeatOutInfoBaseService extends GenericService<MeatOutInfoBase,String> {
//public boolean Login(String userName, String password);
}
service.impl:
@WebService(endpointInterface = "com.sunraw.kunming.service.MeatOutInfoBaseService")
public class MeatOutInfoBaseServiceImpl extends GenericServiceImpl<MeatOutInfoBase, String> implements MeatOutInfoBaseService {

private MeatOutInfoBaseDao meatOutInfoBaseDao;

public void setMeatOutInfoBaseDao(MeatOutInfoBaseDao meatOutInfoBaseDao) {  
  this.meatOutInfoBaseDao = meatOutInfoBaseDao;  
  }

public GenericDao<MeatOutInfoBase, String> getDao(){
return meatOutInfoBaseDao;
}
}


错误提示:
xception in thread "main" com.ibatis.sqlmap.client.SqlMapException: There is no statement named selectSQL in this SqlMap.
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(SqlMapExecutorDelegate.java:293)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:606)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
at org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:298)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:209)
at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:249)
顶一下
(27)
96.4%
踩一下
(1)
3.6%
------分隔线------