欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

MyBatis-plus報(bào)錯Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required的解決方法

 更新時間:2023年12月11日 10:42:49   作者:邊境矢夢°  
這篇文章主要給大家介紹了MyBatis-plus 報(bào)錯 Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required的兩種解決方法,如果遇到相同問題的朋友可以參考借鑒一下

針對報(bào)錯如下:

Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

方法1: 就用SpringBoot 3

如果 pom.xml 中spring-boot-starter-parent 的版本 需要 使用 3.0.0 或以上,則 mybatis-plus-boot-starter 的版本必須為 3.5.3 或以上。對應(yīng)如下兩部分代碼:
<parent> 部分:

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

<dependency> 部分:

        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.5.3</version>
        </dependency>

方法2:不需要使用SpringBoot 3

如果 pom.xml 中spring-boot-starter-parent 的版本 不需要 使用 3.0.0 或以上,則可以將其版本改為 2.7.8 即 SpringBoot 2 版本, mybatis-plus-boot-starter 的版本無需使用最新的 3.5.3(mybatis-plus 在 3.4 和 3.5 版本之間有較大變化,按需使用即可)。
<parent> 部分:

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

<dependency> 部分:

        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.5.3</version>
        </dependency>

以上就是MyBatis-plus報(bào)錯Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required的解決方法的詳細(xì)內(nèi)容,更多關(guān)于MyBatis-plus報(bào)錯sqlSessionFactory的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

最新評論