描述:想要使用actable的同时使用tk.mybatis或者mybatis-plus时可参考如下配置
tk.mybatis配置方式
对于springboot架构的项目,如需使用tk.mybatis只要多依赖一下如下配置即可:
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
<version>2.1.5</version>
</dependency>
对于传统springMVC需要将如下mybatis配置换位tk.mybatis配置,这里参考 springMVC的配置 中的配置替换即可
<!-- 如果不使用tk.mybatis需要使用这个bean成如下: -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="自己的dao.*没有可不填;com.gitee.sunchenbin.mybatis.actable.dao.*" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
<!-- 如果要使用tk.mybatis需要使用这个bean成如下: -->
<bean class="tk.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="自己的dao.*没有可不填;com.gitee.sunchenbin.mybatis.actable.dao.*"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
<property name="properties">
<value>
mappers=tk.mybatis.mapper.common.Mapper,tk.mybatis.mapper.common.special.InsertListMapper
</value>
</property>
</bean>
mybatis-plus配置方式
对于springboot架构的项目,如需使用mybatis-plus只要多依赖一下如下配置即可:
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.1</version>
</dependency>
将mybatis.mapper-locations配置的内容换到mybatis-plus.mapper-locations配置中。
至于springMVC的项目如何配置暂时没有尝试,后续补上,大家自行去查下官网也可以找到哦~