解决 mybatis 加载xml配置文件bug Caused By: org.apache.ibatis.builder.BuilderException: Could not find SQL statement to include with refid 'SAD02.SAD02_COL' at org.apache.ibatis.builder.xml.XMLStatementBuilder$IncludeNodeHandler.handleNode(XMLStatementBuilder.java:160) at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseDynamicTags(XMLStatementBuilder.java:87) at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:45) at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:192) at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:57) Truncated. see log file for complete stacktrace
#P MyBatisCus
Index: src/org/apache/ibatis/builder/xml/XMLMapperBuilder.java
===================================================================
--- src/org/apache/ibatis/builder/xml/XMLMapperBuilder.java (revision 5886)
+++ src/org/apache/ibatis/builder/xml/XMLMapperBuilder.java (working copy)
@@ -19,6 +19,8 @@
private MapperBuilderAssistant builderAssistant;
private Map<String, XNode> sqlFragments;
private String resource;
+ // Mapped Statements collection already contains
+ private boolean ignoreAlreadyMapped = false;
public XMLMapperBuilder(Reader reader, Configuration configuration, String resource, Map<String, XNode> sqlFragments, String namespace) {
this(reader, configuration, resource, sqlFragments);
@@ -32,7 +34,16 @@
this.sqlFragments = sqlFragments;
this.resource = resource;
}
-
+
+ public XMLMapperBuilder(Reader reader, Configuration configuration, String resource, Map<String, XNode> sqlFragments,boolean ignoreAlreadyMapped) {
+ super(configuration);
+ this.builderAssistant = new MapperBuilderAssistant(configuration, resource);
+ this.parser = new XPathParser(reader, true, configuration.getVariables(), new XMLMapperEntityResolver());
+ this.sqlFragments = sqlFragments;
+ this.resource = resource;
+ this.ignoreAlreadyMapped = ignoreAlreadyMapped;
+ }
+
- 粉丝: 12
- 资源: 2
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
- 1
- 2
前往页