给类起别名,
a、单独起名
在配置文件中标签中加入
<typeAliases>
<typeAlias type="com.han.vo.Student" alias="Student"/>
<typeAlias type="com.han.vo.Manager" alias="Manager"/>
</typeAliases>
其中可以写多个,这样在mapper文件中就只需要写别名就可以了
b、集体起别名
在配置文件中标签中加入
<typeAliases>
<package name="com.han.vo"/>
</typeAliases>
这样该包下的所有类都有别名,就是类名本身,无需单独起名,别名大小写不敏感
对于普通的Java类型,有许多内建的类型别名。它们都是大小写不敏感的
别名 类型 _byte byte _long long _short short _int int _integer int _double double _float float _boolean boolean string String byte Byte long Long short Short int Integer integer Integer double Double float Float boolean Boolean date Date decimal BigDecimal bigdecimal BigDecimal object Object map Map hashmap HashMap list List arraylist ArrayList collection Collection iterator Iterator