{"id":388,"date":"2022-10-07T17:25:54","date_gmt":"2022-10-07T08:25:54","guid":{"rendered":"http:\/\/walab.handong.edu\/?p=388"},"modified":"2022-10-07T17:26:49","modified_gmt":"2022-10-07T08:26:49","slug":"mybatis-2%ea%b0%9c-%ec%9d%b4%ec%83%81%ec%9d%98-query%eb%a5%bc-mapper%ec%97%90-%ed%95%9c%eb%b2%88%ec%97%90-%ec%9e%91%ec%84%b1%ed%95%98%ea%b3%a0-%ec%8b%b6%ec%9d%80-%ea%b2%bd%ec%9a%b0","status":"publish","type":"post","link":"http:\/\/walab.handong.edu\/?p=388","title":{"rendered":"MyBatis &#8211; 2\uac1c \uc774\uc0c1\uc758 Query\ub97c mapper\uc5d0 \ud55c\ubc88\uc5d0 \uc791\uc131\ud558\uace0 \uc2f6\uc740 \uacbd\uc6b0"},"content":{"rendered":"\n<p>MyBatis\ub97c \uc801\uc6a9\ud55c Spring Legacy Project\uc5d0\uc11c \uac1c\ubc1c\uc744 \uc9c4\ud589\ud558\ub2e4\ubcf4\uba74 \ubd84\uba85\ud788 \ud558\ub098\uc758 mapper\uc5d0 \ub300\ud574\uc11c 2\uac1c \uc774\uc0c1\uc758 Query\ub97c \ud638\ucd9c\ud558\uace0 \uc2f6\uc740 \uacbd\uc6b0\uac00 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4\uc11c \ud55c\ubc88\uc758 mapper \ud638\ucd9c\ub85c 2\uac1c \uc774\uc0c1\uc758 table\uc5d0 record\ub97c insert \ud558\uace0 \uc2f6\uc740 \uacbd\uc6b0, \uc6b0\ub9ac\ub294 mybatis\uc758 mapper \ub0b4\uc5d0\uc11c 2\uac1c \uc774\uc0c1\uc758 Query\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4\uba74 \uc774\ub7ec\ud55c \ubb38\uc81c\ub97c \uc27d\uac8c \ud574\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uc6b0\ub9ac\uac00 \uac00\uc7a5 \uba3c\uc800 \ub5a0\uc62c\ub9b4 \uc218 \uc788\ub294 \uc544\uc774\ub514\uc5b4\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<pre id=\"code_1642120556702\" class=\"wp-block-code\"><code>&lt;insert id=\"insertStatement\" parameterType=\"hashmap\"&gt;\n    INSERT INTO table1 (member1, member2, member3) VALUES (value1, value2, value3);\n    INSERT INTO table2 (member1, member2, member3) VALUES (value1, value2, value3);\n&lt;\/insert&gt;<\/code><\/pre>\n\n\n\n<p>\ub2e4\uc74c\uacfc \uac19\uc774 &#8216;;&#8217;\uc744 \uc0ac\uc6a9\ud574\uc11c \uac01 SQL\ubb38\uc744 \uad6c\ubd84\ud558\uace0 \ub2e4\uc74c\uacfc \uac19\uc774 \uc791\uc131\ud55c\ub2e4\uba74, \ubb38\uc81c\uc5c6\uc774 \uc798 \ub3d9\uc791\ud560 \uac83\uc774\ub77c \uc0dd\uac01\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud558\uc9c0\ub9cc \uc2e4\ud589\ud574\ubcf4\uba74 SQL Bad Syntax \uc624\ub958\uac00 \ubc1c\uc0dd\ud558\uba70 \uc81c\ub300\ub85c \ub3d9\uc791\ud558\uc9c0 \uc54a\uac8c \ub429\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uc0ac\uc2e4 \uc774\ub294 SQL\ubb38 \uac01\uac01\uc5d0 \ub300\ud574\uc11c Bad Syntax\uac00 \ub098\ud0c0\ub098\ub294 \uac83\uc774 \uc544\ub2d9\ub2c8\ub2e4. \uc774\ub294 DB\uc640 Connection \uad6c\uc131 \uc2dc \uae30\ubcf8\uc801\uc73c\ub85c \ud55c \ubc88\uc758 \uc694\uccad\uc5d0 \ud558\ub098\uc758 Query\ub9cc\uc774 \ub4e4\uc5b4\uac00\ub3c4\ub85d \uc124\uc815\ub418\uc5b4 \uc788\uae30 \ub54c\ubb38\uc785\ub2c8\ub2e4. \ub530\ub77c\uc11c 2\uac1c \uc774\uc0c1\uc758 Query\ub97c mapper\uc5d0\uc11c \uc804\uc1a1\ud558\ub824\uace0 \uc2dc\ub3c4\ud558\uc790 \ubb38\uc81c\uac00 \ubc1c\uc0dd\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \ud558\uc9c0\ub9cc \ub2e4\ud589\uc774\ub3c4 \uc774\ub294 MyBatis\uc640 DB\uac04\uc758 Connection \uc124\uc815 \uc2dc \ud2b9\uc815 parameter\ub97c \uc124\uc815\ud558\uc5ec \ub118\uae40\uc73c\ub85c\uc11c \ud574\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<h2>\uc194\ub8e8\uc158 (allowMultiQueries=true)<\/h2>\n\n\n\n<p>\uc55e\uc5d0\uc11c \uc5b8\uae09\ud588\ub4ef\uc774 \uc774 \ubb38\uc81c\ub294 DB\uc640 Connection \uc124\uc815 \uc2dc \ud2b9\uc815 parameter\ub97c \uc124\uc815\ud558\uc5ec \ub118\uae30\ub294 \uac83\uc73c\ub85c \ud574\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc194\ub8e8\uc158 \uc606\uc5d0 \uad04\ud638\ub85c \uba85\uc2dc\ud55c \uac83\ucc98\ub7fc &#8220;allowMultiQueries=true&#8221;\ub97c \uc635\uc158\uc73c\ub85c \uc124\uc815\ud574\uc11c datasource.url\uc5d0 parameter\ub85c \ud3ec\ud568\uc2dc\ucf1c\uc8fc\uba74 \ub429\ub2c8\ub2e4. \uc774\ub807\uac8c \uc124\uc815\ud574\uc900 \ud6c4 \ud504\ub85c\uc81d\ud2b8\ub97c \uc7ac\ube4c\ub4dc \ud558\uc5ec \uc2e4\ud589\ud558\uba74 \uc704\uc5d0\uc11c \uc6b0\ub9ac\uac00 \uc758\ub3c4\ud588\ub358 \ub300\ub85c \ud504\ub85c\uc81d\ud2b8\uac00 \uc798 \ub3d9\uc791\ud558\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\uc744 \uac83\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h1>Reference<\/h1>\n\n\n\n<p>\ud574\ub2f9 \uae00\uc740 \uc544\ub798\uc758 \ub9c1\ud06c \uc6d0\uc791\uc790\uc758 \ud5c8\uac00\ub97c \ubc1b\uace0 \ubcf5\uc81c\ub418\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<p><a href=\"https:\/\/juyoungit.tistory.com\/643\">https:\/\/juyoungit.tistory.com\/643<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MyBatis\ub97c \uc801\uc6a9\ud55c Spring Legacy Project\uc5d0\uc11c \uac1c\ubc1c\uc744 \uc9c4\ud589\ud558\ub2e4\ubcf4\uba74 \ubd84\uba85\ud788 \ud558\ub098\uc758 mapper\uc5d0 \ub300\ud574\uc11c 2\uac1c \uc774\uc0c1\uc758 Query\ub97c \ud638\ucd9c\ud558\uace0 \uc2f6\uc740 \uacbd\uc6b0\uac00 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4\uc11c \ud55c\ubc88\uc758 mapper \ud638\ucd9c\ub85c 2\uac1c \uc774\uc0c1\uc758 table\uc5d0 record\ub97c insert \ud558\uace0 \uc2f6\uc740 \uacbd\uc6b0, \uc6b0\ub9ac\ub294 mybatis\uc758 mapper \ub0b4\uc5d0\uc11c 2\uac1c \uc774\uc0c1\uc758 Query\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4\uba74 \uc774\ub7ec\ud55c \ubb38\uc81c\ub97c \uc27d\uac8c \ud574\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc6b0\ub9ac\uac00 \uac00\uc7a5 \uba3c\uc800 \ub5a0\uc62c\ub9b4 \uc218 \uc788\ub294 \uc544\uc774\ub514\uc5b4\ub294 \ub2e4\uc74c\uacfc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":""},"categories":[11,5],"tags":[],"_links":{"self":[{"href":"http:\/\/walab.handong.edu\/index.php?rest_route=\/wp\/v2\/posts\/388"}],"collection":[{"href":"http:\/\/walab.handong.edu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/walab.handong.edu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/walab.handong.edu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/walab.handong.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=388"}],"version-history":[{"count":1,"href":"http:\/\/walab.handong.edu\/index.php?rest_route=\/wp\/v2\/posts\/388\/revisions"}],"predecessor-version":[{"id":389,"href":"http:\/\/walab.handong.edu\/index.php?rest_route=\/wp\/v2\/posts\/388\/revisions\/389"}],"wp:attachment":[{"href":"http:\/\/walab.handong.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/walab.handong.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=388"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/walab.handong.edu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}