I am using Spring and MyBatis. I have tried to import another MyBatis file(which is auto-generated) by refering Can we import XML file into another XML file?.
1) MyTest.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" [
<!ENTITY BaseTest.xml SYSTEM "BaseTest.xml" >
]>
<mapper namespace="com.test.abc">
&BaseTest.xml;
<select id="CUSTOMIZED_SELECT">
...
</select>
<insert id="CUSTOMIZED_INSERT">
...
</insert>
</mapper>
2) BaseTest.xml. Actually it's just a XML snippet; it has no xml header nor outer mapper element:
<sql id="GENERAL_WHERE">
...
</sql>
<select id="GENERAL_SELECT">
...
</select>
<insert id="GENERAL_INSERT">
...
</insert>
These two files are located at the same directory. But Spring always complains that it can't find the BaseTest.xml.
Is there any special that I need to adjust ?
BTW, the reason behind BaseTest.xml and MyTest.xml is that BaseTest.xml is auto-generated and MyTest.xml is manual-written.
Thanks!