2022年4月

通俗的解释一下多线程

多线程用于堆积处理,就像一个大土堆,一个推土机很慢,那么10个推土机一起来处理,当然速度就快了,不过由于位置的限制,如果20个推土机,那么推土机之间会产生相互的避让,相互摩擦,相互拥挤,反而不如10个处理的好,所以,多线程处理,线程数要开的恰当,就可以提高效率。

- 阅读剩余部分 -

今天碰见一个版本冲突问题具体冲突如下:

An attempt was made to call a method that does not exist.
The attempt was made from the following location:

com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder.getLanguageDriver
(MybatisMapperAnnotationBuilder.java:369)

The following method did not exist:

com.baomidou.mybatisplus.core.MybatisConfiguration.getLanguageDriver
(Ljava/lang/Class;)Lorg/apache/ibatis/scripting/LanguageDriver;

The method's class, com.baomidou.mybatisplus.core.MybatisConfiguration,
is available from the following locations:
当时的spirngboot版本和mybatis版本如下:(这是修改以后又重新指定了一下mybatis的版本指定为最新版本的了。)

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.7.RELEASE</version>
    <relativePath/>
</parent>
<!--定义版本-->
<properties>
  <mybatis.plus.starter.version>3.1.1</mybatis.plus.starter.version>
</properties>
<!--解决myabatis版本冲突问题-->
<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>mybatis-plus-boot-starter</artifactId>
    <version>${mybatis.plus.starter.version}</version>

</dependency>
是这个方法找不到,然后我就添加了如下配置:(最后解决问题)
<parent>

    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.7.RELEASE</version>
    <relativePath/>
</parent>

<!--定义版本-->
<properties>
  <mybatis.plus.starter.version>3.1.1</mybatis.plus.starter.version>
</properties>

        <!--解决myabatis版本冲突问题-->
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>${mybatis.plus.starter.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>mybatis</artifactId>
                    <groupId>org.mybatis</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.5.6</version>
        </dependency>