ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 张鑫宇 <ZHANGXINYU...@PAIC.com.cn>
Subject 答复: About reuse SQL-fragments ??
Date Fri, 30 Dec 2005 09:50:37 GMT
HI:
    I hava solved it by reconfig the sqlMapConfig file~~
 
Before:
<sqlMapConfig>
 <sqlMap resource="sqlmap-Test.xml"/>
 <sqlMap resource="sqlmap-global.xml"/>
</sqlMapConfig>
After:
<sqlMapConfig>
  <sqlMap resource="sqlmap-global.xml"/>
  <sqlMap resource="sqlmap-Test.xml"/>
</sqlMapConfig>
 
xinyu

________________________________

发件人: 张鑫宇 [mailto:ZHANGXINYU004@PAIC.com.cn] 
发送时间: 2005年12月30日 17:13
收件人: user-java@ibatis.apache.org
主题: About reuse SQL-fragments ??
重要性: 高


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
 


********************************************************************************************************************************
The information in this email is confidential and may be legally privileged. If you have received
this email in error or are
not the intended recipient, please immediately notify the sender and delete this message from
your computer. Any use, distribution,
or copying of this email other than by the intended recipient is strictly prohibited. All
messages sent to and from us may be 
monitored to ensure compliance with internal policies and to protect our business. 
Emails are not secure and cannot be guaranteed to be error free as they can be intercepted,
amended, lost or destroyed, 
or contain viruses. Anyone who communicates with us by email is taken to accept these risks.


收发邮件者请注意:
本邮件含保密信息,若误收本邮件,请务必通知发送人并直接删去,不得使用、传播或复制本邮件。
进出邮件均受到本公司合规监控。邮件可能发生被截留、被修改、丢失、被破坏或包含计算机病毒等不安全情况。

********************************************************************************************************************************
Mime
View raw message