<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="typeAliasesPackage" value="com.xxx"/>
<property name="typeAliasesSuperType" value="com.xxx.xxx.Xxx"/>
<property name="mapperLocations" value="classpath:/mappings/**/*.xml"/>
<property name="configLocation" value="classpath:/mybatis-config.xml"></property>
</bean>
加粗放大的这两行即是。
要为【com.xxx】下目标类生成别名的话,那么这些类必须继承同一个父类【com.xxx.xxx.Xxx】,