Type-aliases-package function
In Mybatis file, the resultType type or paramterType will return a custom entity. At this time, these entities can be specified with the full class name.
For example:
<select resultType=""> SELECT <include ref/> FROM USER_INFO WHERE 1=1 </select>
The resultType in it returns the full class name.
Actually, it can be usedtype-aliases-package
Specify the entity scan package class in the entity to let mybatis scan to a custom entity.
type-aliases-package configuration
- In springboot
type-aliases-package
Configuration
-aliases-package=
- SpringMVC
typeAliasesPackage
Configuration
<bean class=""> <!-- Data Source --> <property name="dataSource" ref="datasource"></property> <!-- Alias --> <property name="typeAliasesPackage" value=""></property> <!-- sqlMap file path --> <property name="mapperLocations" value="classpath*:mapper/*"></property> </bean>
Summarize
The above is personal experience. I hope you can give you a reference and I hope you can support me more.