Article From:https://www.cnblogs.com/shengulong/p/9967690.html

mybatisTo configure

<!-- Configure mybatis - & gt;< bean id= "sqlSessionFactory"class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="configLocation" value="classpath:mybatis/mybatis-config.xml"/>
        <!-- mapperScanning - & gt;Property name= "mapperLocations" value= "classpath: mybatis/mapper/*.xml"/>Lt; / Bean & gt;< bean id= "sqlSession Template"class="org.mybatis.spring.SqlSessionTemplate">
        <constructor-arg ref="sqlSessionFactory" />
    </bean>

    <!-- mapperBatch scanning, scanning the mapper interface from the mapper package, automatically creating proxy objects and registering in the spring container - & gt;< beanclass="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <!-- If multiple packages are scanned, the number of each package is separated, and the wildcard character - & gt cannot be used.< property name= "basePackage" value= "com.dqc.dal.dao"/≫Property name = "sqlSessionFactory BeanName" value = "sqlSessionFactory" / & gt;< /bEan>

 From the configuration file, you can see that the sqlSession Template used is: org. mybatis. spring. SqlSession Template, enter the source code.

Then jump to: You can see the notes:@return int The number of rows affected by the delete.

Note that you must download the source code of the jar package before you can see the annotations

 

 

 

Reference resources:

https://blog.csdn.net/gaojinshan/article/details/24308313

Leave a Reply

Your email address will not be published. Required fields are marked *