日期:2014-05-20  浏览次数:20637 次

spring+ibatis下报错:There is no statement named selectSQL in this SqlMap
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;