在mapper映射配置文件中,需要使用 paramterType、resultType 来设置 sql 语句的输入输出参数,一般参数都是基本的数据类型或封装类型,为了简化,可以使用别名的方法。
- 批量命名别名时,默认别名为类名(不区别大小写)
<configuration>
<type-Aliases>
<package name="com.mason.entiy"/>
</type-Aliases>
</configuration>
- 单个类自定义命名别名
<configuration>
<type-Aliases>
<typeAlias type="com.mason.entiy.User" alias="user"/>
</type-Aliases>
</configuration>