springboot, between mybatis multi-module project, how to refer to each other between two projects a resultMap, do not have to write each project

springboot, Mybatis in resultMap mybatis multi-module project in two projects of how to share (the same definition must be repeated each mapper.xml resultMap in it)

1. If A project needs to reference resultMap B project, add B projects in pom.xml file referenced A

		<dependency>
			<groupId>cn.com.yawei.hotline</groupId>
			<artifactId>common</artifactId>
			<version>0.0.1-SNAPSHOT</version>
		</dependency>

Figure: I quoted is called the common project of
Here Insert Picture Description

2. Add yml disposed inside the document A, B of the scanning xml

mybatis:
  mapper-locations: classpath*:mapper/*.xml

Find mybatis configuration, the original of the CLASSPATH: Mapper / .xml ※ replaced the CLASSPATH: Mapper / .xml, that is behind calsspath plus ※ asterisk

Plus namespace path .resultMap B project name when referring to 3.A project xml file to

Quote
Here Insert Picture Description

Released nine original articles · won praise 4 · Views 3137

Guess you like

Origin blog.csdn.net/weixin_43642706/article/details/103583983