Mybatis数据库操作的返回值
mybatis配置
<!-- 配置mybatis --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="configLocation" value="classpath:mybatis/mybatis-config.xml"/> <!-- mapper扫描 --> <property name="mapperLocations" value="classpath:mybatis/mapper/*.xml"/> </bean> <bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate"> <constructor-arg ref="sqlSessionFactory" /> </bean> <!-- mapper批量扫描,从mapper包中扫描mapper接口,自动创建代理对象并且在spring容器中注册 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <!-- 如果扫描多个包,每个包中间用,号分隔,不能使用通配符 --> <property name="basePackage" value="com.dqc.dal.dao" /> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" /> </bean>
从配置文件可知所用的sqlSessionTemplate为:org.mybatis.spring.SqlSessionTemplate,进入源码
然后跳转到:可以看到注释里的说明:@return int The number of rows affected by the delete.
注意,一定要下载jar包的源码,才可以看到注释的内容
参考:
https://blog.csdn.net/gaojinshan/article/details/24308313