有一个与接口关联的 XML 映射FirstMapper
:
<mapper namespace="my.very.long.path.to.package.with.mappers.FirstMapper">
<select id="selectAll" resultType="map">
SELECT * FROM my_table
</select>
</mapper>
包含全名,namespace
包括包名,所有映射器都具有相同的长前缀。是否有可能概括(或参数化)这个前缀?
例如,而不是具有这些声明的映射器
1. <mapper namespace="my.very.long.path.to.package.with.mappers.FirstMapper"> ...
2. <mapper namespace="my.very.long.path.to.package.with.mappers.abc.SecondMapper"> ...
3. <mapper namespace="my.very.long.path.to.package.with.mappers.xyz.ThirdMapper"> ...
有类似的东西会很好
1. <mapper namespace="FirstMapper"> ...
2. <mapper namespace="abc.SecondMapper"> ...
3. <mapper namespace="xyz.ThirdMapper"> ...
或者至少
1. <mapper namespace="${nsPrefix}.FirstMapper"> ...
2. <mapper namespace="${nsPrefix}.abc.SecondMapper"> ...
3. <mapper namespace="${nsPrefix}.xyz.ThirdMapper"> ...