mybatis configuration file

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!--Configure database connection-->
<property name="dataSource" ref="dataSource"/>
<!--Configure mapping file -->
<property name="mapperLocations" value="classpath:com/awcloud/core/dao/*.xml"/>
<!--Alias ​​-->
<property name="typeAliasesPackage" value="com.awcloud .core.bean,com.awcloud.core.query"/>
</bean>

<!-- The DAO layer is handed over to mybatis, and the spring scan and package scan provided by mybatis -->
<bean class="org.mybatis. spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.awcloud.core.dao"/>
</bean>
Mapping file.xml configuration
<!-- <!-- where namespace must be the path of the UserMapper interface" -->-->
<mapper namespace="com.awcloud.core.dao.usermng.UserDao" >



<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
		<property name="dataSource" ref="dataSource"/>
		<property name="mapperLocations" value="classpath:com/awcloud/core/dao/*.xml"/>
		<!--Alias-->
		<property name="typeAliasesPackage" value="com.awcloud.core.bean,com.awcloud.core.query"/>
	</bean>


Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327026138&siteId=291194637