精华内容
下载资源
问答
  • tk.mybatis

    2020-11-20 10:39:06
    tk.mybatismapper更新update方法具体实现追踪 mapper更新update方法具体实现追踪 MapperFactory类 import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import com.xxx.Entity; import tk....

    mapper更新update方法具体实现追踪

    MapperFactory类

    import java.util.Map;
    import java.util.concurrent.ConcurrentHashMap;
    
    import com.xxx.Entity;
    
    import tk.mybatis.mapper.common.Mapper;
    
    public class MapperFactory {
    
    	private static Map<Class<? extends Entity>, Mapper<? extends Entity>> mapperFactory = new ConcurrentHashMap<>();
    	
    	public static void register(Class<? extends Entity> cls, Mapper<? extends Entity> mapper) {
    		mapperFactory.put(cls, mapper);
    	}
    	
    	public static Mapper<? extends Entity> get(Entity en){
    		return mapperFactory.get(en.getImplementedInterface());
    	}
    	
    }
    
    Mapper mapper = MapperFactory.get(entity);
    if (mapper == null) {
    	return false;
    }
    mapper.updateByPrimaryKeySelective(entity);
    

    ctrl左键 点进去updateByPrimaryKeySelective方法里边

    package tk.mybatis.mapper.common.base.update;
    
    import org.apache.ibatis.annotations.UpdateProvider;
    import tk.mybatis.mapper.annotation.RegisterMapper;
    import tk.mybatis.mapper.provider.base.BaseUpdateProvider;
    
    @RegisterMapper
    public interface UpdateByPrimaryKeySelectiveMapper<T> {
        @UpdateProvider(
            type = BaseUpdateProvider.class,
            method = "dynamicSQL"
        )
        int updateByPrimaryKeySelective(T var1);
    }
    

    点BaseUpdateProvider

    package tk.mybatis.mapper.provider.base;
    
    import org.apache.ibatis.mapping.MappedStatement;
    import tk.mybatis.mapper.mapperhelper.MapperHelper;
    import tk.mybatis.mapper.mapperhelper.MapperTemplate;
    import tk.mybatis.mapper.mapperhelper.SqlHelper;
    
    public class BaseUpdateProvider extends MapperTemplate {
        public BaseUpdateProvider(Class<?> mapperClass, MapperHelper mapperHelper) {
            super(mapperClass, mapperHelper);
        }
    
        public String updateByPrimaryKey(MappedStatement ms) {
            Class<?> entityClass = this.getEntityClass(ms);
            StringBuilder sql = new StringBuilder();
            sql.append(SqlHelper.updateTable(entityClass, this.tableName(entityClass)));
            sql.append(SqlHelper.updateSetColumns(entityClass, (String)null, false, false));
            sql.append(SqlHelper.wherePKColumns(entityClass, true));
            return sql.toString();
        }
    
        public String updateByPrimaryKeySelective(MappedStatement ms) {
            Class<?> entityClass = this.getEntityClass(ms);
            StringBuilder sql = new StringBuilder();
            sql.append(SqlHelper.updateTable(entityClass, this.tableName(entityClass)));
            sql.append(SqlHelper.updateSetColumns(entityClass, (String)null, true, this.isNotEmpty()));
            sql.append(SqlHelper.wherePKColumns(entityClass, true));
            return sql.toString();
        }
    }
    
    
    展开全文
  • java.lang.NoSuchMethodException: tk.mybatis.mapper.provider.base.BaseSelectProvider.&lt;init&gt;() 浏览器访问:http://localhost:8081/category/list?pid=0 解决办法: 应该导入import tk....

    控制台报错:

            java.lang.NoSuchMethodException:tk.mybatis.mapper.provider.base.BaseSelectProvider.<init>()

    浏览器访问:http://localhost:8081/category/list?pid=0 

    解决办法:

    应该导入import tk.mybatis.spring.annotation.MapperScan这个包。

     

    展开全文
  • Springboo集成tk.mybatis

    2020-04-06 15:51:10
    Springboo集成tk.mybatis
  • tk.mybatis配置使用方法

    万次阅读 2020-06-13 09:10:20
    tk.mybatis配置使用方法 学习的博客:https://www.cnblogs.com/alimayun/p/12572350.html

    tk.mybatis配置使用方法

    学习的博客:https://www.cnblogs.com/alimayun/p/12572350.html

    展开全文
  • spring-boot+tk.mybatis通用mapper
  • 主要介绍了tk.mybatis扩展通用接口使用详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
  • 主要介绍了Spring Boot整合tk.mybatis代码实例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
  • spring4.0 集成 tk.mybatis插件,增删改无需增删改查,快速开发
  • 使用tk.mybatis插入数据报错:Cause: java.lang.InstantiationException: tk.mybatis.mapper.provider.base.BaseSelectProvider 具体报错: org.mybatis.spring.MyBatisSystemException: nested exception is org....

    使用tk.mybatis插入数据报错:Cause: java.lang.InstantiationException: tk.mybatis.mapper.provider.base.BaseSelectProvider

    具体报错:

    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method (tk.mybatis.mapper.provider.base.BaseSelectProvider.dynamicSQL). Cause: java.lang.InstantiationException: tk.mybatis.mapper.provider.base.BaseSelectProvider
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77) ~[mybatis-spring-1.3.2.jar:1.3.2]
    at org.mybatis.spring.SqlSessionTemplateSqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) [mybatisspring1.3.2.jar:1.3.2]atcom.sun.proxy.SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) ~[mybatis-spring-1.3.2.jar:1.3.2] at com.sun.proxy.Proxy55.selectOne(Unknown Source) ~[na:na]
    at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166) ~[mybatis-spring-1.3.2.jar:1.3.2]
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:83) ~[mybatis-3.4.6.jar:3.4.6]
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) ~[mybatis-3.4.6.jar:3.4.6]
    at com.sun.proxy.Proxy60.selectByPrimaryKey(UnknownSource) [na:na]atcom.nari.acs.host.service.Impl.SpInfoServiceImpl.getSpInfo(SpInfoServiceImpl.java:21) [classes/:na]atcom.nari.acs.host.controller.QueryBusinessController.getSpInfo(QueryBusinessController.java:65) [classes/:na]atcom.nari.acs.host.controller.QueryBusinessController.getSIMList(QueryBusinessController.java:898) [classes/:na]atcom.nari.acs.host.service.Impl.SIMInfoServiceImpl.insertSIM(SIMInfoServiceImpl.java:55) [classes/:na]atcom.nari.acs.host.controller.SIMManagementController.insertSim(SIMManagementController.java:61)[classes/:na]atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod) [na:1.8.0152]atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [na:1.8.0152]atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0152]atjava.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0152]atorg.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)[springweb5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)[springweb5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)[springwebmvc5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)[springwebmvc5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)[springwebmvc5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)[springwebmvc5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)[springwebmvc5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)[springwebmvc5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)[springwebmvc5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)[springwebmvc5.1.18.RELEASE.jar:5.1.18.RELEASE]atjavax.servlet.http.HttpServlet.service(HttpServlet.java:652)[tomcatembedcore9.0.38.jar:4.0.FR]atorg.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)[springwebmvc5.1.18.RELEASE.jar:5.1.18.RELEASE]atjavax.servlet.http.HttpServlet.service(HttpServlet.java:733)[tomcatembedcore9.0.38.jar:4.0.FR]atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)[tomcatembedwebsocket9.0.38.jar:9.0.38]atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcatembedcore9.0.38.jar:9.0.38]atorg.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)[springweb5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)[springweb5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcatembedcore9.0.38.jar:9.0.38]atorg.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)[springweb5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)[springweb5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcatembedcore9.0.38.jar:9.0.38]atorg.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:94)[springweb5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)[springweb5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcatembedcore9.0.38.jar:9.0.38]atorg.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)[springweb5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)[springweb5.1.18.RELEASE.jar:5.1.18.RELEASE]atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.coyote.AbstractProtocolProxy60.selectByPrimaryKey(Unknown Source) ~[na:na] at com.nari.acs.host.service.Impl.SpInfoServiceImpl.getSpInfo(SpInfoServiceImpl.java:21) ~[classes/:na] at com.nari.acs.host.controller.QueryBusinessController.getSpInfo(QueryBusinessController.java:65) ~[classes/:na] at com.nari.acs.host.controller.QueryBusinessController.getSIMList(QueryBusinessController.java:898) ~[classes/:na] at com.nari.acs.host.service.Impl.SIMInfoServiceImpl.insertSIM(SIMInfoServiceImpl.java:55) ~[classes/:na] at com.nari.acs.host.controller.SIMManagementController.insertSim(SIMManagementController.java:61) [classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_152] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_152] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_152] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_152] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) [spring-web-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) [spring-web-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) [spring-webmvc-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892) [spring-webmvc-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) [spring-webmvc-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) [spring-webmvc-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) [spring-webmvc-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) [spring-webmvc-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) [spring-webmvc-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) [spring-webmvc-5.1.18.RELEASE.jar:5.1.18.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:652) [tomcat-embed-core-9.0.38.jar:4.0.FR] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) [spring-webmvc-5.1.18.RELEASE.jar:5.1.18.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) [tomcat-embed-core-9.0.38.jar:4.0.FR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.38.jar:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) [spring-web-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) [spring-web-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:94) [spring-web-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.coyote.AbstractProtocolConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-9.0.38.jar:9.0.38]
    at org.apache.tomcat.util.net.NioEndpointSocketProcessor.doRun(NioEndpoint.java:1590)[tomcatembedcore9.0.38.jar:9.0.38]atorg.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)[tomcatembedcore9.0.38.jar:9.0.38]atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[na:1.8.0152]atjava.util.concurrent.ThreadPoolExecutorSocketProcessor.doRun(NioEndpoint.java:1590) [tomcat-embed-core-9.0.38.jar:9.0.38] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.38.jar:9.0.38] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_152] at java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624) [na:1.8.0_152]
    at org.apache.tomcat.util.threads.TaskThreadWrappingRunnable.run(TaskThread.java:61)[tomcatembedcore9.0.38.jar:9.0.38]atjava.lang.Thread.run(Thread.java:748)[na:1.8.0152]Causedby:org.apache.ibatis.builder.BuilderException:ErrorinvokingSqlProvidermethod(tk.mybatis.mapper.provider.base.BaseSelectProvider.dynamicSQL).Cause:java.lang.InstantiationException:tk.mybatis.mapper.provider.base.BaseSelectProvideratorg.apache.ibatis.builder.annotation.ProviderSqlSource.createSqlSource(ProviderSqlSource.java:134) [mybatis3.4.6.jar:3.4.6]atorg.apache.ibatis.builder.annotation.ProviderSqlSource.getBoundSql(ProviderSqlSource.java:102) [mybatis3.4.6.jar:3.4.6]atorg.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:292) [mybatis3.4.6.jar:3.4.6]atorg.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81) [mybatis3.4.6.jar:3.4.6]atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) [mybatis3.4.6.jar:3.4.6]atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) [mybatis3.4.6.jar:3.4.6]atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77) [mybatis3.4.6.jar:3.4.6]atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod) [na:1.8.0152]atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [na:1.8.0152]atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0152]atjava.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0152]atorg.mybatis.spring.SqlSessionTemplateWrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.38.jar:9.0.38] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152] Caused by: **org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method** (tk.mybatis.mapper.provider.base.BaseSelectProvider.dynamicSQL). Cause: java.lang.InstantiationException: tk.mybatis.mapper.provider.base.BaseSelectProvider at org.apache.ibatis.builder.annotation.ProviderSqlSource.createSqlSource(ProviderSqlSource.java:134) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.builder.annotation.ProviderSqlSource.getBoundSql(ProviderSqlSource.java:102) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:292) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77) ~[mybatis-3.4.6.jar:3.4.6] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_152] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_152] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_152] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_152] at org.mybatis.spring.SqlSessionTemplateSqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) ~[mybatis-spring-1.3.2.jar:1.3.2]
    … 64 common frames omitted
    Caused by: java.lang.InstantiationException: tk.mybatis.mapper.provider.base.BaseSelectProvider
    at java.lang.Class.newInstance(Class.java:427) ~[na:1.8.0_152]
    at org.apache.ibatis.builder.annotation.ProviderSqlSource.invokeProviderMethod(ProviderSqlSource.java:165) ~[mybatis-3.4.6.jar:3.4.6]
    at org.apache.ibatis.builder.annotation.ProviderSqlSource.createSqlSource(ProviderSqlSource.java:116) ~[mybatis-3.4.6.jar:3.4.6]
    … 75 common frames omitted
    Caused by: java.lang.NoSuchMethodException: tk.mybatis.mapper.provider.base.BaseSelectProvider.()
    at java.lang.Class.getConstructor0(Class.java:3082) ~[na:1.8.0_152]
    at java.lang.Class.newInstance(Class.java:412) ~[na:1.8.0_152]
    … 77 common frames omitted

    3. 问题原因及解决方案

    项目统一与数据库交互使用tk.mybatis,要把之前mybatisPlus写的改成使用tk.mybatis,修改过程中,在SpringBoot的启动类上,使用@MapperScan注解时引入了错误的包。

    正确的应该是:import tk.mybatis.spring.annotation.MapperScan;

    错误的引入了:import org.mybatis.spring.annotation.MapperScan;

    如果使用tk.mybatis引入第一个,使用mybatisPlus引入第二个。

    展开全文
  • springboot项目,引用了tk.mybatis,mapper继承了通用的extends BaseMapper,但是没有ByExample这些,不知道是哪出错了。![图片说明](https://img-ask.csdn.net/upload/202005/20/1589967714_841672.png) ``` ...
  • <div><p>使用tk.mybatis.spring.mapper.MapperScannerConfigurer的setBasePackage配置了Mapper接口, 但org.mybatis.spring.mapper.ClassPathMapperScanner#doScan方法会报 No MyBatis mapper was found in &#...
  • nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method (tk.mybatis.mapper.provider.base.BaseUp...
  • tk.mybatis.mapper.common.Mapper的样例使用
  • at tk.mybatis.spring.mapper.SpringBootBindUtil$SpringBoot2Bind.bind(SpringBootBindUtil.java:129) ~[mapper-spring-boot-autoconfigure-1.2.3.jar:na] at tk.mybatis.spring.mapper.SpringBo
  • tk.mybatis错误

    2020-04-08 21:55:24
    博主,尝试了一天的tk.mybatis,最终发现了这个错误。 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method (tk....
  • org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method (tk.mybatis.mapper.provider.base.BaseInsertProvider.dynamic...
  • 错误提示:java.lang.NoSuchMethodException: tk.mybatis.mapper.provider.base 使用通用mapper时要注意导入的是tk.mybatis.spring.annotation.MapperScan 若没有使用通用mapper将“tk”,换成“org”即可。 ...
  • SpringBoot使用tk.mybatis整合Mybatis

    千次阅读 2020-04-19 19:37:48
    SpringBoot使用tk.mybatis整合Mybatis pom.xml <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot...
  • mysqlmysql-connector-java5.1.47tk.mybatismapper-spring-boot-starter2.1.5org.mybatis.generatormybatis-generator-maven-plugin1.3.6${basedir}/src/main/resources/generator/generatorConfig.xmltruetruemysql...
  • Cause: java.lang.InstantiationException: tk.mybatis.mapper.provider.base.BaseSelectProvider bug分析 在MapperScan导包的时候出现了问题 这个是不对的
  • (tk.mybatis.mapper.provider.base.BaseInsertProvider.dynamicSQL). Cause: java.lang.InstantiationException: tk.mybatis.mapper.provider.base.BaseInsertProvider 1、错误原因是因为自己 导入依赖有问题,刚...
  • 错误信息org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method (tk.mybatis.mapper.provider.base.BaseSelectProvider...
  • java.lang.NoSuchMethodException:tk.mybatis.mapper.provider.base.BaseSelectProvider.<init>() 错误引入MapperScan:import org.mybatis.spring.annotation.MapperScan; 解决问题(错误引入包导致) 正确的...
  • 闲谈tk.mybatis

    2020-04-28 10:40:54
    一、tk.mybatis说明 tk.mybatis可以帮助我们完成基本的curd操作,本文基于tk.mybatis开发了插件,可以让我们的dao层代码不修改一行直接使用,当然如果需要复杂sql需要自己写,和之前的方法相同。 二、插件 1、依赖 &...
  • java.lang.NoSuchMethodException: tk.mybatis.mapper.provider.base.BaseSelectProvider.&lt;init&gt;() at java.lang.Class.getConstructor0(Class.java:3082) ~[na:1.8.0_181] at java.lang.Class.new....
  • org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method (tk.mybatis.mapper.provider.base.BaseInsertProvider.dynamic...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 2,227
精华内容 890
关键字:

tk.mybatis