{"id":16792,"date":"2024-12-24T13:37:32","date_gmt":"2024-12-24T05:37:32","guid":{"rendered":"https:\/\/92it.top\/?p=16792"},"modified":"2024-12-24T13:37:32","modified_gmt":"2024-12-24T05:37:32","slug":"%e7%90%86%e8%a7%a3-mybatis%e7%bc%93%e5%ad%98%e6%9c%ba%e5%88%b6","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=16792","title":{"rendered":"\u7406\u89e3 MyBatis\u7f13\u5b58\u673a\u5236"},"content":{"rendered":"\n<p><a href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzIwNDAyOTI2Nw==&amp;mid=2247501142&amp;idx=1&amp;sn=35a1c04aa7bcbc853b9726eb7f7f8df1&amp;chksm=96c4e96aa1b3607cd1fd5b1e1bcc44ea7e4868247692dee5e8b6697dbb3464cef4175ea58473&amp;cur_album_id=2818595943724974083&amp;scene=190#rd\">\u8f6c\u8f7d\uff1a\u8fd9\u6837\u7406\u89e3 MyBatis\u7f13\u5b58\u673a\u5236\uff0c\u771f\u9999\uff01<\/a><\/p>\n\n\n\n<p>\u4e3a\u4e86\u63d0\u9ad8\u6570\u636e\u8bbf\u95ee\u7684\u6027\u80fd\uff0cMyBatis \u91c7\u7528\u4e86\u4e00\u7ea7\u7f13\u5b58\u548c\u4e8c\u7ea7\u7f13\u5b58\u7684\u7f13\u5b58\u673a\u5236\uff0c\u90a3\u4e48\u5b83\u4eec\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1f\u8fd9\u7bc7\u6587\u7ae0\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e24\u79cd\u7f13\u5b58\u673a\u5236\u53ca\u5176\u5de5\u4f5c\u539f\u7406\u3001\u914d\u7f6e\u65b9\u5f0f\u548c\u4f7f\u7528\u573a\u666f\u3002\u9996\u5148\uff0c\u770b\u4e00\u5f20\u539f\u7406\u56fe\uff1a<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"610\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/12\/\u56fe\u7247-1-1024x610.png\" alt=\"\" class=\"wp-image-16794\" style=\"width:498px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/12\/\u56fe\u7247-1-1024x610.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2024\/12\/\u56fe\u7247-1-300x179.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2024\/12\/\u56fe\u7247-1-768x458.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2024\/12\/\u56fe\u7247-1-830x495.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2024\/12\/\u56fe\u7247-1-230x137.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2024\/12\/\u56fe\u7247-1-350x209.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2024\/12\/\u56fe\u7247-1-480x286.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2024\/12\/\u56fe\u7247-1.png 1114w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u63a5\u7740\uff0c\u6211\u4eec\u6765\u8be6\u7ec6\u5730\u5206\u6790\u5b83\u4eec\u3002<\/p>\n\n\n\n<p><strong>1. \u4e00\u7ea7\u7f13\u5b58<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u4e00\u7ea7\u7f13\u5b58\uff08\u4e5f\u53eb\u672c\u5730\u7f13\u5b58\uff09\u662f MyBatis \u9ed8\u8ba4\u5f00\u542f\u7684\uff0c\u662f\u57fa\u4e8e SqlSession \u7ea7\u522b\u7684\u7f13\u5b58\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728\u540c\u4e00\u4e2a SqlSession \u4e2d\uff0c\u5bf9\u4e8e\u76f8\u540c\u7684\u67e5\u8be2\uff0c\u5982\u679c\u53c2\u6570\u76f8\u540c\uff0cMyBatis \u4f1a\u4ece\u4e00\u7ea7\u7f13\u5b58\u4e2d\u76f4\u63a5\u83b7\u53d6\u6570\u636e\uff0c\u800c\u4e0d\u4f1a\u518d\u53bb\u6267\u884c\u6570\u636e\u5e93\u67e5\u8be2\u3002<\/p>\n\n\n\n<p><strong>1.1 \u7279\u70b9<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>\u4f5c\u7528\u8303\u56f4<\/strong>\uff1a\u540c\u4e00\u4e2a<code>SqlSession<\/code>\u00a0\u5b9e\u4f8b\u3002<\/li>\n\n\n\n<li><strong>\u9ed8\u8ba4\u5f00\u542f<\/strong>\uff1a\u65e0\u9700\u989d\u5916\u914d\u7f6e\u3002<\/li>\n\n\n\n<li><strong>\u6e05\u7a7a\u65f6\u673a<\/strong>\uff1a\n<ul>\n<li>\u6267\u884c<code>insert<\/code>\u3001<code>update<\/code>\u3001<code>delete<\/code>\u00a0\u64cd\u4f5c\u65f6\uff0c\u4e00\u7ea7\u7f13\u5b58\u4f1a\u88ab\u6e05\u7a7a\u3002<\/li>\n\n\n\n<li>\u8c03\u7528<code>SqlSession.clearCache()<\/code>\u00a0\u65b9\u6cd5\u624b\u52a8\u6e05\u7a7a\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>1.2 \u5de5\u4f5c\u539f\u7406<\/strong><\/p>\n\n\n\n<p>\u5f53\u4f7f\u7528\u540c\u4e00\u4e2a<code>SqlSession<\/code>&nbsp;\u6267\u884c\u76f8\u540c\u7684 SQL \u67e5\u8be2\u65f6\uff0cMyBatis \u4f1a\u5148\u68c0\u67e5\u4e00\u7ea7\u7f13\u5b58\u662f\u5426\u5b58\u5728\u5bf9\u5e94\u7684\u67e5\u8be2\u7ed3\u679c\u3002\u5982\u679c\u5b58\u5728\uff0c\u5219\u76f4\u63a5\u8fd4\u56de\u7f13\u5b58\u4e2d\u7684\u7ed3\u679c\uff1b\u5982\u679c\u4e0d\u5b58\u5728\uff0c\u5219\u6267\u884c\u6570\u636e\u5e93\u67e5\u8be2\u5e76\u5c06\u7ed3\u679c\u653e\u5165\u4e00\u7ea7\u7f13\u5b58\u3002<\/p>\n\n\n\n<p><strong>\u4f7f\u7528\u793a\u4f8b<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">try (SqlSession session = sqlSessionFactory.openSession()) {\n    UserMapper mapper = session.getMapper(UserMapper.class);\n    User user1 = mapper.getUserById(1); \/\/ \u67e5\u8be2\u6570\u636e\u5e93\uff0c\u7ed3\u679c\u5b58\u5165\u4e00\u7ea7\u7f13\u5b58\n    User user2 = mapper.getUserById(1); \/\/ \u4ece\u4e00\u7ea7\u7f13\u5b58\u4e2d\u83b7\u53d6\u7ed3\u679c\n    \/\/ user1 \u548c user2 \u6307\u5411\u540c\u4e00\u4e2a\u5bf9\u8c61\n}\n<\/pre>\n\n\n\n<p><strong>2. \u4e8c\u7ea7\u7f13\u5b58\uff08\u5168\u5c40\u7f13\u5b58\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u4e8c\u7ea7\u7f13\u5b58\u662f\u57fa\u4e8e namespace\uff08\u901a\u5e38\u5bf9\u5e94\u4e8e Mapper \u63a5\u53e3\uff09\u7684\u7f13\u5b58\uff0c\u4f5c\u7528\u8303\u56f4\u8d85\u51fa\u4e86<code>SqlSession<\/code>\uff0c\u540c\u4e00\u4e2a mapper \u7684\u591a\u4e2a<code>SqlSession<\/code>&nbsp;\u5171\u4eab\u4e00\u7ea7\u7f13\u5b58\u4e4b\u5916\u7684\u7f13\u5b58\u3002\u4e8c\u7ea7\u7f13\u5b58\u9700\u8981\u663e\u5f0f\u5f00\u542f\u548c\u914d\u7f6e\u3002<\/p>\n\n\n\n<p><strong>2.1 \u7279\u70b9<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>\u4f5c\u7528\u8303\u56f4<\/strong>\uff1a\u540c\u4e00\u4e2a Mapper \u7684\u6240\u6709<code>SqlSession<\/code>\u00a0\u5b9e\u4f8b\u3002<\/li>\n\n\n\n<li><strong>\u9ed8\u8ba4\u5173\u95ed<\/strong>\uff1a\u9700\u8981\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u624b\u52a8\u5f00\u542f\u3002<\/li>\n\n\n\n<li><strong>\u7f13\u5b58\u5b9e\u73b0<\/strong>\uff1a\u9700\u8981\u914d\u7f6e\u7f13\u5b58\u5b9e\u73b0\u7c7b\uff0c\u5982 MyBatis \u81ea\u5e26\u7684\u7f13\u5b58\u6216\u7b2c\u4e09\u65b9\u7f13\u5b58\uff08\u4f8b\u5982 Ehcache\u3001Redis\uff09\u3002<\/li>\n\n\n\n<li><strong>\u5e8f\u5217\u5316<\/strong>\uff1a\u4e8c\u7ea7\u7f13\u5b58\u4e2d\u7684\u5bf9\u8c61\u9700\u8981\u5e8f\u5217\u5316\uff0c\u4ee5\u652f\u6301\u8de8<code>SqlSession<\/code>\u00a0\u5171\u4eab\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>2.2 \u542f\u7528\u6b65\u9aa4<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>\u5168\u5c40\u914d\u7f6e<\/strong>\uff1a\u5728\u5168\u5c40\u914d\u7f6e\u6587\u4ef6<code>mybatis-config.xml<\/code>\u00a0\u4e2d\u5f00\u542f\u4e8c\u7ea7\u7f13\u5b58\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;configuration>\n  &lt;settings>\n      &lt;setting name=\"cacheEnabled\" value=\"true\"\/>\n  &lt;\/settings>\n  ...\n&lt;\/configuration>\n<\/pre>\n\n\n\n<ul>\n<li><strong>Mapper \u914d\u7f6e<\/strong>\uff1a\u5728\u6bcf\u4e2a\u9700\u8981\u4f7f\u7528\u4e8c\u7ea7\u7f13\u5b58\u7684 Mapper XML \u6587\u4ef6\u4e2d\u914d\u7f6e<code>&lt;cache><\/code>\u00a0\u6807\u7b7e\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;mapper namespace=\"com.example.mapper.UserMapper\">\n  &lt;cache\/>\n  &lt;!-- SQL \u8bed\u53e5\u5b9a\u4e49 -->\n&lt;\/mapper>\n<\/pre>\n\n\n\n<p>\u6216\u8005\u4f7f\u7528\u81ea\u5b9a\u4e49\u7f13\u5b58\u5b9e\u73b0\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;cache type=\"org.mybatis.caches.ehcache.EhcacheCache\"\/>\n<\/pre>\n\n\n\n<ul>\n<li><strong>\u6620\u5c04\u63a5\u53e3\u6ce8\u89e3<\/strong>\uff1a\u53ef\u4ee5\u901a\u8fc7\u6ce8\u89e3\u65b9\u5f0f\u914d\u7f6e\u7f13\u5b58\uff08\u9002\u7528\u4e8e MyBatis 3.2 \u53ca\u4ee5\u4e0a\u7248\u672c\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">@CacheNamespace\npublic interface UserMapper {\n  \/\/ \u65b9\u6cd5\u5b9a\u4e49\n}\n<\/pre>\n\n\n\n<p><strong>2.3 \u7f13\u5b58\u6e05\u7406\u7b56\u7565<\/strong><\/p>\n\n\n\n<p>MyBatis \u4e8c\u7ea7\u7f13\u5b58\u4f7f\u7528\u7684\u662f\u57fa\u4e8e\u8bfb\u5199\u7684\u7f13\u5b58\u7b56\u7565\uff0c\u5f53\u6d89\u53ca\u6570\u636e\u4fee\u6539\u64cd\u4f5c\uff08<code>insert<\/code>\u3001<code>update<\/code>\u3001<code>delete<\/code>\uff09\u65f6\uff0c\u4f1a\u6e05\u7406\u76f8\u5173 Mapper \u7684\u4e8c\u7ea7\u7f13\u5b58\uff0c\u4ee5\u4fdd\u8bc1\u6570\u636e\u4e00\u81f4\u6027\u3002<\/p>\n\n\n\n<p><strong>\u4f7f\u7528\u793a\u4f8b<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u7b2c\u4e00\u4e2a SqlSession\ntry (SqlSession session1 = sqlSessionFactory.openSession()) {\n    UserMapper mapper1 = session1.getMapper(UserMapper.class);\n    User user1 = mapper1.getUserById(1); \/\/ \u67e5\u8be2\u6570\u636e\u5e93\uff0c\u7ed3\u679c\u5b58\u5165\u4e00\u7ea7\u548c\u4e8c\u7ea7\u7f13\u5b58\n    session1.commit();\n}\n\n\/\/ \u7b2c\u4e8c\u4e2a SqlSession\ntry (SqlSession session2 = sqlSessionFactory.openSession()) {\n    UserMapper mapper2 = session2.getMapper(UserMapper.class);\n    User user2 = mapper2.getUserById(1); \/\/ \u4ece\u4e8c\u7ea7\u7f13\u5b58\u4e2d\u83b7\u53d6\u7ed3\u679c\n}\n<\/pre>\n\n\n\n<p><strong>3. \u7f13\u5b58\u7684\u9ad8\u7ea7\u914d\u7f6e<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>3.1 \u7f13\u5b58\u5237\u65b0\u7b56\u7565<\/strong><\/p>\n\n\n\n<p>\u53ef\u4ee5\u901a\u8fc7<code>&lt;cache&gt;<\/code>&nbsp;\u6807\u7b7e\u7684\u5c5e\u6027\u6765\u914d\u7f6e\u7f13\u5b58\u7684\u5237\u65b0\u7b56\u7565\uff0c\u5982\uff1a<\/p>\n\n\n\n<ul>\n<li><code>eviction<\/code>\uff1a\u6307\u5b9a\u7f13\u5b58\u7684\u6e05\u7406\u7b56\u7565\uff08\u9ed8\u8ba4 LRU \u7b56\u7565\uff09\u3002<\/li>\n\n\n\n<li><code>flushInterval<\/code>\uff1a\u6307\u5b9a\u7f13\u5b58\u5237\u65b0\u65f6\u95f4\u95f4\u9694\uff08\u5355\u4f4d\uff1a\u6beb\u79d2\uff09\u3002<\/li>\n\n\n\n<li><code>size<\/code>\uff1a\u6307\u5b9a\u7f13\u5b58\u7684\u5927\u5c0f\u3002<\/li>\n\n\n\n<li><code>readOnly<\/code>\uff1a\u6307\u5b9a\u7f13\u5b58\u662f\u5426\u4e3a\u53ea\u8bfb\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;cache\n    eviction=\"FIFO\"\n    flushInterval=\"60000\"\n    size=\"512\"\n    readOnly=\"true\"\/>\n<\/pre>\n\n\n\n<p><strong>3.2 \u4f7f\u7528\u7b2c\u4e09\u65b9\u7f13\u5b58<\/strong><\/p>\n\n\n\n<p>MyBatis \u652f\u6301\u96c6\u6210\u591a\u79cd\u7b2c\u4e09\u65b9\u7f13\u5b58\uff0c\u5982 Ehcache\u3001Redis\u3001Hazelcast \u7b49\u3002\u4ee5 Ehcache \u4e3a\u4f8b\uff0c\u914d\u7f6e\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul>\n<li><strong>\u6dfb\u52a0\u4f9d\u8d56<\/strong>\uff1a<\/li>\n<\/ul>\n\n\n\n<ol><\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;dependency>\n  &lt;groupId>org.mybatis.caches&lt;\/groupId>\n&lt;artifactId>mybatis-ehcache&lt;\/artifactId>\n&lt;version>1.2.1&lt;\/version>\n&lt;\/dependency>\n&lt;dependency>\n&lt;groupId>net.sf.ehcache&lt;\/groupId>\n&lt;artifactId>ehcache&lt;\/artifactId>\n&lt;version>2.10.6&lt;\/version>\n&lt;\/dependency>\n<\/pre>\n\n\n\n<ul>\n<li><strong>\u914d\u7f6e Mapper<\/strong>\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;cache type=\"org.mybatis.caches.ehcache.EhcacheCache\"\/>\n<\/pre>\n\n\n\n<ul>\n<li><strong>\u914d\u7f6e Ehcache<\/strong>\uff1a<\/li>\n<\/ul>\n\n\n\n<p>\u521b\u5efa<code>ehcache.xml<\/code>\u00a0\u6587\u4ef6\uff0c\u914d\u7f6e\u7f13\u5b58\u7b56\u7565\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;ehcache>\n    &lt;cache name=\"com.example.mapper.UserMapper\"\n           maxEntriesLocalHeap=\"1000\"\n           eternal=\"false\"\n           timeToIdleSeconds=\"300\"\n           timeToLiveSeconds=\"600\"\n           overflowToDisk=\"false\"\/>\n&lt;\/ehcache>\n<\/pre>\n\n\n\n<p><strong>4. \u7f13\u5b58\u4f7f\u7528\u6ce8\u610f\u4e8b\u9879<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<ol>\n<li><strong>\u6570\u636e\u4e00\u81f4\u6027<\/strong>\uff1a\u4f7f\u7528\u4e8c\u7ea7\u7f13\u5b58\u65f6\uff0c\u9700\u8981\u786e\u4fdd\u7f13\u5b58\u4e0e\u6570\u636e\u5e93\u7684\u6570\u636e\u4e00\u81f4\u6027\uff0c\u7279\u522b\u662f\u5728\u5206\u5e03\u5f0f\u73af\u5883\u4e0b\uff0c\u63a8\u8350\u4f7f\u7528\u5206\u5e03\u5f0f\u7f13\u5b58\u89e3\u51b3\u65b9\u6848\u3002<\/li>\n\n\n\n<li><strong>\u5bf9\u8c61\u53ef\u5e8f\u5217\u5316<\/strong>\uff1a\u4e8c\u7ea7\u7f13\u5b58\u4e2d\u7684\u5bf9\u8c61\u9700\u8981\u5b9e\u73b0<code>Serializable<\/code>\u00a0\u63a5\u53e3\uff0c\u4ee5\u652f\u6301\u7f13\u5b58\u7684\u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316\u3002<\/li>\n\n\n\n<li><strong>\u907f\u514d\u7f13\u5b58\u7a7f\u900f<\/strong>\uff1a\u5bf9\u9ad8\u9891\u7387\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u9002\u5f53\u914d\u7f6e\u7f13\u5b58\uff0c\u4ece\u800c\u51cf\u5c11\u6570\u636e\u5e93\u7684\u538b\u529b\u3002<\/li>\n\n\n\n<li><strong>\u7f13\u5b58\u547d\u4e2d\u7387<\/strong>\uff1a\u5408\u7406\u8bbe\u8ba1\u67e5\u8be2\u8bed\u53e5\u548c\u7f13\u5b58\u7b56\u7565\uff0c\u63d0\u5347\u7f13\u5b58\u7684\u547d\u4e2d\u7387\uff0c\u4f18\u5316\u6027\u80fd\u3002<\/li>\n<\/ol>\n\n\n\n<p><strong>5. \u603b\u7ed3<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u672c\u6587\uff0c\u6211\u4eec\u8be6\u7ec6\u5730\u4ecb\u7ecd\u4e86 MyBatis \u7684\u7f13\u5b58\u7b56\u7565\uff0c\u5305\u62ec\u4e00\u7ea7\u7f13\u5b58\u9002\u7528\u4e8e\u5355\u6b21\u8bf7\u6c42\u4e2d\u7684\u91cd\u590d\u67e5\u8be2\uff0c\u800c\u4e8c\u7ea7\u7f13\u5b58\u9002\u7528\u4e8e\u8de8\u8bf7\u6c42\u7684\u5171\u4eab\u7f13\u5b58\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5e94\u6839\u636e\u5177\u4f53\u4e1a\u52a1\u9700\u6c42\u548c\u7cfb\u7edf\u67b6\u6784\uff0c\u9009\u62e9\u5408\u9002\u7684\u7f13\u5b58\u7b56\u7565\u548c\u5b9e\u73b0\u65b9\u5f0f\uff0c\u4ee5\u8fbe\u5230\u6700\u4f73\u7684\u6027\u80fd\u4f18\u5316\u6548\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d\uff1a\u8fd9\u6837\u7406\u89e3 MyBatis\u7f13\u5b58\u673a\u5236\uff0c\u771f\u9999\uff01 \u4e3a\u4e86\u63d0\u9ad8\u6570\u636e\u8bbf\u95ee\u7684\u6027\u80fd\uff0cMyBatis \u91c7\u7528\u4e86\u4e00\u7ea7\u7f13\u5b58\u548c\u4e8c\u7ea7\u7f13 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,23],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/16792"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16792"}],"version-history":[{"count":1,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/16792\/revisions"}],"predecessor-version":[{"id":16795,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/16792\/revisions\/16795"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}