Hi:
    The url below said:
The <include>-tag is namespace-aware so you can refer to fragments even when they are located in another map.
    http://opensource2.atlassian.com/confluence/oss/pages/viewpage.action?pageId=707
 
so we write the two sqlMap file like below:
 
sqlMap-Test.xml:
<sqlMap namespace="test">
 
<select id="query_id" parameterClass="CountableQueryCriteria" resultClass="java.util.HashMap" remapResults="true">
 <include refid="global.prefixSql"/>  
 select * from account_main
 <include refid="global.suffixSql"/>
</select> 
</sqlMap>
 
sqlMap-Global.xml
 
<sqlMap namespace="global">
 <sql id="prefixSql">
    …………………………
 </sql>
 <sql id="suffixSql">
    ………………………
 </sql>
</sqlMap>
 
but when i used it i get the error:
 
com.paic.pafa.app.lwc.core.beans.factory.BeanCreationException: Error occurred.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'.  Cause: com.ibatis.common.exception.NestedRuntimeException: Could not find SQL statement to include with refid 'global.prefixSql'
Caused by: com.ibatis.common.exception.NestedRuntimeException: Could not find SQL statement to include with refid 'global.prefixSql'
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'.  Cause: com.ibatis.common.exception.NestedRuntimeException: Could not find SQL statement to include with refid 'global.prefixSql'
Caused by: com.ibatis.common.exception.NestedRuntimeException: Could not find SQL statement to include with refid 'global.prefixSql'
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'.  Cause: com.ibatis.common.exception.NestedRuntimeException: Could not find SQL statement to include with refid 'global.prefixSql'
Caused by: com.ibatis.common.exception.NestedRuntimeException: Could not find SQL statement to include with refid 'global.prefixSql'
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'.  Cause: com.ibatis.common.exception.NestedRuntimeException: Could not find SQL statement to include with refid 'global.prefixSql'
…………………………
 
help me please!
 
Thanks,
xinyu
 

Reply via email to