{"id":203084,"date":"2025-05-22T09:56:56","date_gmt":"2025-05-22T01:56:56","guid":{"rendered":"https:\/\/server.hk\/cnblog\/203084\/"},"modified":"2025-05-22T09:56:56","modified_gmt":"2025-05-22T01:56:56","slug":"springboot-%e9%a1%b9%e7%9b%ae%e6%97%a0%e7%ab%af%e6%8a%a5%e9%94%99%ef%bc%8c%e5%a6%82%e4%bd%95%e6%8e%92%e9%99%a4-mybatis-plus-%e5%92%8c-spring-boot-%e7%89%88%e6%9c%ac%e4%b8%8d%e5%85%bc%e5%ae%b9%e5%af%bc","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/203084\/","title":{"rendered":"SpringBoot \u9879\u76ee\u65e0\u7aef\u62a5\u9519\uff0c\u5982\u4f55\u6392\u9664 MyBatis-Plus \u548c Spring Boot \u7248\u672c\u4e0d\u517c\u5bb9\u5bfc\u81f4\u7684\u9519\u8bef\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>SpringBoot \u9879\u76ee\u65e0\u7aef\u62a5\u9519\uff0c\u5982\u4f55\u6392\u9664 MyBatis-Plus \u548c Spring Boot \u7248\u672c\u4e0d\u517c\u5bb9\u5bfc\u81f4\u7684\u9519\u8bef\uff1f<\/h1>\n<p>\u672c\u7bc7\u6587\u7ae0\u7ed9\u5927\u5bb6\u5206\u4eab\u300aSpringBoot \u9879\u76ee\u65e0\u7aef\u62a5\u9519\uff0c\u5982\u4f55\u6392\u9664 MyBatis-Plus \u548c Spring Boot \u7248\u672c\u4e0d\u517c\u5bb9\u5bfc\u81f4\u7684\u9519\u8bef\uff1f\u300b\uff0c\u8986\u76d6\u4e86\u6587\u7ae0\u7684\u5e38\u89c1\u57fa\u7840\u77e5\u8bc6\uff0c\u5176\u5b9e\u4e00\u4e2a\u8bed\u8a00\u7684\u5168\u90e8\u77e5\u8bc6\u70b9\u4e00\u7bc7\u6587\u7ae0\u662f\u4e0d\u53ef\u80fd\u8bf4\u5b8c\u7684\uff0c\u4f46\u5e0c\u671b\u901a\u8fc7\u8fd9\u4e9b\u95ee\u9898\uff0c\u8ba9\u8bfb\u8005\u5bf9\u81ea\u5df1\u7684\u638c\u63e1\u7a0b\u5ea6\u6709\u4e00\u5b9a\u7684\u8ba4\u8bc6(B \u6570)\uff0c\u4ece\u800c\u5f25\u8865\u81ea\u5df1\u7684\u4e0d\u8db3\uff0c\u66f4\u597d\u7684\u638c\u63e1\u5b83\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241028\/1730078333671ee67da9ac8.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>springboot \u9879\u76ee\u65e0\u7aef\u62a5\u9519\uff0c\u5bfb\u6839\u7a76\u5e95<\/strong><\/p>\n<p>\u867d\u7136\u9879\u76ee\u4ee3\u7801\u672a\u7ecf\u4fee\u6539\uff0c\u4f46\u4eca\u5929\u542f\u52a8\u65f6\u5374\u7a81\u7136\u629b\u51fa\u65e0\u6cd5\u89e3\u91ca\u7684\u9519\u8bef\uff1a<\/p>\n<pre>creating a new sqlsession\nsqlsession [org.apache.ibatis.session.defaults.defaultsqlsession@2dbe837b] was not registered for synchronization because synchronization is not active<\/pre>\n<p>\u56f0\u60d1\u4e0d\u5df2\uff0c\u56e0\u4e3a\u5e76\u6ca1\u6709\u4efb\u4f55\u9519\u8bef\u7684\u4ee3\u7801\u3002\u7136\u800c\uff0c\u4ed4\u7ec6\u68c0\u67e5\u5374\u53d1\u73b0\u4e86\u4e00\u4e2a\u5173\u952e\u70b9\uff1a\u6b64\u9519\u8bef\u6307\u5411\u4e86\u4e00\u4e2a mybatis \u76f8\u5173\u7684\u95ee\u9898\u3002<\/p>\n<p>\u6df1\u5165\u8003\u5bdf spring boot \u9879\u76ee\u7684\u914d\u7f6e\uff0c\u53d1\u73b0 mybatis-plus \u7684\u76f8\u5173\u914d\u7f6e\uff1a<\/p>\n<pre>mybatis-plus:\n  config-location: classpath:mybatis\/mybatis-config.xml\n  mapper-locations: classpath:mybatis\/mapper\/*.xml<\/pre>\n<p>\u5c1d\u8bd5\u5728\u7f51\u4e0a\u5bfb\u627e\u7b54\u6848\uff0c\u4e0d\u5c11\u6587\u7ae0\u63d0\u5230\u4e86\u4ee3\u7801\u9519\u8bef\u5bfc\u81f4\u7684\u7c7b\u4f3c\u9519\u8bef\u3002\u7136\u800c\uff0c\u4ed4\u7ec6\u5ba1\u9605\u4ee3\u7801\u540e\uff0c\u5e76\u6ca1\u6709\u53d1\u73b0\u4efb\u4f55\u9519\u8bef\u3002<\/p>\n<p>\u8fdb\u4e00\u6b65\u63a2\u5bfb\uff0c\u53d1\u73b0\u4e86\u4e00\u7bc7\u535a\u6587\uff08https:\/\/blog.csdn.net\/web1829&#8230;\uff09\uff0c\u6307\u51fa\u8be5\u9519\u8bef\u53ef\u80fd\u662f\u7531\u4e8e mybatis-plus \u7684\u7248\u672c\u548c spring boot \u7248\u672c\u4e0d\u517c\u5bb9\u9020\u6210\u7684\u3002<\/p>\n<p>\u6839\u636e\u535a\u6587\u7684\u5efa\u8bae\uff0c\u5347\u7ea7 spring boot \u7248\u672c\u81f3 2.5.5\uff0c\u5e76\u91cd\u65b0\u7f16\u8bd1\u9879\u76ee\u3002\u4ee4\u4eba\u60ca\u559c\u7684\u662f\uff0c\u9519\u8bef\u6d88\u5931\uff0c\u9879\u76ee\u5f97\u4ee5\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<p>\u7531\u6b64\u53ef\u89c1\uff0c\u5373\u4f7f\u9879\u76ee\u672a\u7ecf\u4fee\u6539\uff0c\u914d\u7f6e\u4e2d\u7684\u517c\u5bb9\u6027\u95ee\u9898\u4e5f\u53ef\u80fd\u5bfc\u81f4\u770b\u4f3c\u83ab\u540d\u5176\u5999\u7684\u9519\u8bef\u3002\u6240\u4ee5\uff0c\u9047\u5230\u6b64\u7c7b\u95ee\u9898\u65f6\uff0c\u8981\u4ece\u4ee3\u7801\u4ee5\u5916\u7684\u89d2\u5ea6\u601d\u8003\uff0c\u5982\u68c0\u67e5\u914d\u7f6e\u3001\u5e93\u7248\u672c\u7b49\u65b9\u9762\uff0c\u624d\u80fd\u6709\u6548\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u672c\u6587\u5230\u6b64\u7ed3\u675f\uff0c\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u300aSpringBoot \u9879\u76ee\u65e0\u7aef\u62a5\u9519\uff0c\u5982\u4f55\u6392\u9664 MyBatis-Plus \u548c Spring Boot \u7248\u672c\u4e0d\u517c\u5bb9\u5bfc\u81f4\u7684\u9519\u8bef\uff1f\u300b\uff0c\u5e0c\u671b\u672c\u6587\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01\u5173\u6ce8\u516c\u4f17\u53f7\uff0c\u7ed9\u5927\u5bb6\u5206\u4eab\u66f4\u591a\u6587\u7ae0\u77e5\u8bc6\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SpringBoot \u9879\u76ee\u65e0\u7aef\u62a5&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-203084","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=203084"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203084\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=203084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=203084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=203084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}