{"id":1071,"date":"2019-07-15T22:38:15","date_gmt":"2019-07-15T13:38:15","guid":{"rendered":"https:\/\/ito-u-oti.com\/?p=1071"},"modified":"2020-07-10T17:33:38","modified_gmt":"2020-07-10T08:33:38","slug":"post-1071","status":"publish","type":"post","link":"https:\/\/ito-u-oti.com\/?p=1071","title":{"rendered":"\u3010SpringBoot\u3011\u3010MyBatis\u3011SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092Entitiy\u306b\u683c\u7d0d\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u5229\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092INSERT\u3059\u308b\u6642\u306b\u4e3b\u30ad\u30fc\u306a\u3069\u3092\u81ea\u52d5\u3067\u5272\u308a\u5f53\u3066\u308b\u3068\u3044\u3063\u305f\u6642\u306b\u3001\u5272\u308a\u5f53\u3066\u305f\u5024\u3092Entity\u306b\u683c\u7d0d\u3057\u305f\u3044\u5834\u5408\u306e\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__1\" class=\"wp-block-heading\">\u524d\u63d0<\/h2>\n\n\n\n<h3 id=\"outline__1_1\" class=\"wp-block-heading\">INSERT\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u60c5\u5831<\/h3>\n\n\n\n<p><a href=\"http:\/\/www.postgresqltutorial.com\/postgresql-sample-database\/\">postgresql\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u30c6\u30fc\u30d6\u30eb\u7fa4<\/a>\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 id=\"outline__1_1_1\" class=\"wp-block-heading\">\u30c6\u30fc\u30d6\u30eb\u30c7\u30fc\u30bf\uff08Address\u30c6\u30fc\u30d6\u30eb\uff09<\/h4>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2019\/07\/image.png\" alt=\"\" class=\"wp-image-1072\" width=\"507\" height=\"208\"\/><figcaption>address_id\u304c\u4e3b\u30ad\u30fc\u3067\u3001\u4eca\u56de\u30b7\u30fc\u30b1\u30f3\u30b9\u306b\u3088\u3063\u3066\u81ea\u52d5\u3067\u5024\u3092\u5272\u308a\u5f53\u3066\u307e\u3059\u3002<\/figcaption><\/figure>\n\n\n\n<h4 id=\"outline__1_1_2\" class=\"wp-block-heading\">\u30b7\u30fc\u30b1\u30f3\u30b9\u30c7\u30fc\u30bf<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE SEQUENCE public.address_address_id_seq\n\tINCREMENT BY 1\n\tMINVALUE 1\n\tMAXVALUE 9223372036854775807\n\tSTART 1\n\tCACHE 1\n\tNO CYCLE;\n<\/pre><\/div>\n\n\n<h2 id=\"outline__2\" class=\"wp-block-heading\">\u5b9f\u88c5<\/h2>\n\n\n\n<h3 id=\"outline__2_1\" class=\"wp-block-heading\">\u30d7\u30ed\u30c0\u30af\u30c8\u30b3\u30fc\u30c9<\/h3>\n\n\n\n<h4 id=\"outline__2_1_1\" class=\"wp-block-heading\">Address.java<\/h4>\n\n\n\n<p>INSERT\u3059\u308bEntity\u3067\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n@Data\n@NoArgsConstructor\n@AllArgsConstructor\n@Builder\npublic class Address {\n\n    int addressId;\n    String address;\n    String address2;\n    String district;\n    int cityId;\n    String postalCode;\n    String phone;\n    LocalDateTime lastUpdate;\n}\n<\/pre><\/div>\n\n\n<h4 id=\"outline__2_1_2\" class=\"wp-block-heading\">AddressMapper.java<\/h4>\n\n\n\n<p>Mybatis\u3092\u5229\u7528\u3057\u3066Address\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u3092INSERT\u3057\u307e\u3059\u3002<br>\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u30d9\u30fc\u30b9\u3067\u306e\u5b9f\u88c5\u3067\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n@Mapper\npublic interface AddressMapper {\n\n\n    @Insert(&quot;INSERT INTO address (&quot; +\n            &quot;address_id,&quot; +\n            &quot;address,&quot; +\n            &quot;address2,&quot; +\n            &quot;district,&quot; +\n            &quot;city_id,&quot; +\n            &quot;postal_code,&quot; +\n            &quot;phone,&quot; +\n            &quot;last_update&quot; +\n            &quot;)&quot; +\n            &quot;VALUES (&quot; +\n            &quot;address_address_id_seq.NEXTVAL,&quot; +\n            &quot;#{address.address},&quot; +\n            &quot;#{address.address2},&quot; +\n            &quot;#{address.district},&quot; +\n            &quot;#{address.cityId},&quot; +\n            &quot;#{address.postalCode},&quot; +\n            &quot;#{address.phone},&quot; +\n            &quot;#{address.lastUpdate}&quot; +\n            &quot;)&quot;)\n    @Options(useGeneratedKeys = true, keyColumn = &quot;address_id&quot;, keyProperty = &quot;address.addressId&quot;)\n    void save(@Param(&quot;address&quot;) Address address);\n}\n<\/pre><\/div>\n\n\n<p>\u4e3b\u30ad\u30fc\u3067\u3042\u308baddress_id\u3092\u3001\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u4f7f\u7528\u3057\u3066\u5024\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>@Options\u3067\u6307\u5b9a\u3057\u3066\u3044\u308b\u306e\u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u305faddress_id\u3092Entity\u306eaddress\u306b\u683c\u7d0d\u3059\u308b\u8a2d\u5b9a\u3067\u3059\u3002<\/p>\n\n\n\n<p>useGeneratedKeys\u30fb\u30fb\u30fb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5074\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u305f\u30ad\u30fc\u3092\u53d6\u5f97\u3059\u308b\u3002\u5b9f\u969b\u306b\u306fJDBC\u306egetGeneratedKeys\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3002<br>keyColumn\u30fb\u30fb\u30fb\u30c6\u30fc\u30d6\u30eb\u5185\u3067\u81ea\u52d5\u751f\u6210\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5217\u540d\u3002\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u8907\u6570\u6307\u5b9a\u5bfe\u5fdc\u3002<br>keyProperty\u30fb\u30fb\u30fbkeyColumn\u3067\u6307\u5b9a\u3055\u308c\u305f\u5217\u540d\u3092\u3053\u3053\u3067\u6307\u5b9a\u3057\u305f\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u30bb\u30c3\u30c8\u3059\u308b\u3002\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u8907\u6570\u6307\u5b9a\u5bfe\u5fdc\u3002<\/p>\n\n\n\n<h3 id=\"outline__2_2\" class=\"wp-block-heading\">\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9<\/h3>\n\n\n\n<h4 id=\"outline__2_2_1\" class=\"wp-block-heading\">AddressMapperTests.java<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nprivate AddressMapper target;\n\n@DisplayName(&quot;1\u4ef6Insert\u3057\u3001\u30b7\u30fc\u30b1\u30f3\u30b9\u306b\u3088\u3063\u3066\u81ea\u52d5\u751f\u6210\u3055\u308c\u305f\u5024\u3092\u691c\u8a3c\u3059\u308b&quot;)\n        @Test\n        void test1Insert() {\n\n            \/\/GIVEN\n            Address actualCase = Address.builder()\n                    .address(&quot;613 Korolev Drive&quot;)\n                    .district(&quot;Shibuya&quot;)\n                    .cityId(1)\n                    .phone(&quot;28303384290&quot;)\n                    .lastUpdate(LocalDateTime.of(2015, 5, 2, 8, 50))\n                    .build();\n\n            \/\/WHEN\n            target.save(actualCase);\n\n            \/\/THEN\n            assertThat(actualCase.getAddressId()).isEqualTo(1);\n\n            int expect = jdbcTemplate.queryForObject(&quot;SELECT COUNT(*) FROM address&quot;, Integer.class);\n            assertThat(expect).isEqualTo(1);\n\n        }\n<\/pre><\/div>\n\n\n<p>INSERT\u3059\u308b\u30c7\u30fc\u30bf\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3044\u308bactualCase\u3067\u3001\u4e3b\u30ad\u30fc\u3067\u3042\u308baddressId\u304c\u30bb\u30c3\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\uff08int\u306a\u306e\u3067\u521d\u671f\u50240\u304c\u5165\u308a\u307e\u3059\u3002\uff09<\/p>\n\n\n\n<p>target.save\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u5f8c\u3001addressId\u30921\u3067assert\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3064\u307e\u308a\u3001\u30e1\u30bd\u30c3\u30c9\u5b9f\u884c\u5f8c\u306bactualCase\u306e\u4e2d\u306b\u81ea\u52d5\u751f\u6210\u3055\u308c\u305faddressId\u304c\u683c\u7d0d\u3055\u308c\u305f\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__3\" class=\"wp-block-heading\">\u5099\u8003<\/h2>\n\n\n\n<h3 id=\"outline__3_1\" class=\"wp-block-heading\">@SelectKey\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u65b9\u6cd5<\/h3>\n\n\n\n<p>@Options\u3067\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3068\u306f\u5225\u306b\u3001@SelectKey\u3067\u81ea\u52d5\u751f\u6210\u3059\u308b\u65b9\u6cd5\u3082\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u5834\u5408\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<h4 id=\"outline__2_1_2\" class=\"wp-block-heading\">AddressMapper.java<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n    @Insert(&quot;INSERT INTO address (&quot; +\n            &quot;address_id,&quot; +\n            &quot;address,&quot; +\n            &quot;address2,&quot; +\n            &quot;district,&quot; +\n            &quot;city_id,&quot; +\n            &quot;postal_code,&quot; +\n            &quot;phone,&quot; +\n            &quot;last_update&quot; +\n            &quot;)&quot; +\n            &quot;VALUES (&quot; +\n            &quot;#{address.addressId},&quot; +\n            &quot;#{address.address},&quot; +\n            &quot;#{address.address2},&quot; +\n            &quot;#{address.district},&quot; +\n            &quot;#{address.cityId},&quot; +\n            &quot;#{address.postalCode},&quot; +\n            &quot;#{address.phone},&quot; +\n            &quot;#{address.lastUpdate}&quot; +\n            &quot;)&quot;)\n    @SelectKey(statement = &quot;SELECT address_address_id_seq.NEXTVAL&quot;,\n            keyProperty = &quot;address.addressId&quot;,\n            before = true,\n            resultType = Integer.class)\n    void save(@Param(&quot;address&quot;) Address address);\n<\/pre><\/div>\n\n\n<p>@SelectKey\u3067\u30b7\u30fc\u30b1\u30f3\u30b9\u3092SELECT\u3057\u3066\u3001\u4e8b\u524d\u306baddressId\u306b\u81ea\u52d5\u751f\u6210\u3055\u308c\u305f\u5024\u3092\u683c\u7d0d\u3055\u305b\u3066\u3001\u305d\u308c\u3092\u5229\u7528\u3057\u3066INSERT\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u306a\u306e\u3067\u3001INSERT\u306eVALUES\u53e5\u306eaddress_id\u306e\u90e8\u5206\u3082\u5909\u308f\u3063\u3066\u3044\u308b<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>@Options\u306e\u65b9\u6cd5\u2026SQL\u5074\u3067\u81ea\u52d5\u751f\u6210\u3055\u305b\u3001SQL\u304c\u5b9f\u884c\u3055\u308c\u305f\u5f8c\u3067\u5024\u3092Entity\u306b\u683c\u7d0d\u3059\u308b\u3002<\/li><li>@SelectKey\u306e\u65b9\u6cd5\u2026INSERT\u3088\u308a\u524d\u306bSELECT\u306b\u3088\u3063\u3066\u30b7\u30fc\u30b1\u30f3\u30b9\u304b\u3089\u81ea\u52d5\u751f\u6210\u3055\u308c\u305f\u5024\u3092Entity\u306b\u683c\u7d0d\u3057\u3001\u305d\u306e\u30c7\u30fc\u30bf\u3092INSERT\u3057\u3066\u3044\u308b\u3002<\/li><\/ul>\n\n\n\n<p>\u3068\u3044\u3046\u611f\u3058\u3002<br>@SelectKey\u3060\u3068SQL\u304c\u4e00\u3064\u591a\u304f\u767a\u884c\u3055\u308c\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<h2 id=\"outline__4\" class=\"wp-block-heading\">\u53c2\u8003<\/h2>\n\n\n\n<p><a href=\"http:\/\/www.mybatis.org\/mybatis-3\/ja\/sqlmap-xml.html\">Mybatis\u516c\u5f0f<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u5229\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092INSERT\u3059\u308b\u6642\u306b\u4e3b\u30ad\u30fc\u306a\u3069\u3092\u81ea\u52d5\u3067\u5272\u308a\u5f53\u3066\u308b\u3068\u3044\u3063\u305f\u6642\u306b\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":273,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,24],"tags":[255,254,13,253,238],"class_list":["post-1071","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mybatis","category-spring","tag-options","tag-selectkey","tag-mybatis","tag-sequence","tag-spring-boot"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u5229\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092INSERT\u3059\u308b\u6642\u306b\u4e3b\u30ad\u30fc\u306a\u3069\u3092\u81ea\u52d5\u3067\u5272\u308a\u5f53\u3066\u308b\u3068\u3044\u3063\u305f\u6642\u306b\u3001\u5272\u308a\u5f53\u3066\u305f\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"\u3044\u3068\u3068\u3044\"\/>\n\t<meta name=\"google-site-verification\" content=\"dHfPMd0QGg17gHdKjRsKPMBchJp5FPXghry3uflwfwM\" \/>\n\t<meta name=\"keywords\" content=\"spring boot,mybatis,sequence,@options,@selectkey\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/ito-u-oti.com\/?p=1071\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"ja_JP\" \/>\n\t\t<meta property=\"og:site_name\" content=\"\u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\u3010SpringBoot\u3011\u3010MyBatis\u3011SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092Entitiy\u306b\u683c\u7d0d\u3059\u308b\u65b9\u6cd5 | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1\" \/>\n\t\t<meta property=\"og:description\" content=\"SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u5229\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092INSERT\u3059\u308b\u6642\u306b\u4e3b\u30ad\u30fc\u306a\u3069\u3092\u81ea\u52d5\u3067\u5272\u308a\u5f53\u3066\u308b\u3068\u3044\u3063\u305f\u6642\u306b\u3001\u5272\u308a\u5f53\u3066\u305f\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/ito-u-oti.com\/?p=1071\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2018\/03\/mybatis.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2018\/03\/mybatis.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"259\" \/>\n\t\t<meta property=\"og:image:height\" content=\"194\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-07-15T13:38:15+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-07-10T08:33:38+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"\u3010SpringBoot\u3011\u3010MyBatis\u3011SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092Entitiy\u306b\u683c\u7d0d\u3059\u308b\u65b9\u6cd5 | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1\" \/>\n\t\t<meta name=\"twitter:description\" content=\"SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u5229\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092INSERT\u3059\u308b\u6642\u306b\u4e3b\u30ad\u30fc\u306a\u3069\u3092\u81ea\u52d5\u3067\u5272\u308a\u5f53\u3066\u308b\u3068\u3044\u3063\u305f\u6642\u306b\u3001\u5272\u308a\u5f53\u3066\u305f\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@itouoti_IoT\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2018\/03\/mybatis.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071#article\",\"name\":\"\\u3010SpringBoot\\u3011\\u3010MyBatis\\u3011SQL\\u306e\\u30b7\\u30fc\\u30b1\\u30f3\\u30b9\\u3067\\u81ea\\u52d5\\u751f\\u6210\\u3055\\u308c\\u308b\\u30c7\\u30fc\\u30bf\\u3092Entitiy\\u306b\\u683c\\u7d0d\\u3059\\u308b\\u65b9\\u6cd5 | \\u30f0\\u5200\\u306e\\u304a\\u3082\\u3061\\u3083\\u7bb1\",\"headline\":\"\\u3010SpringBoot\\u3011\\u3010MyBatis\\u3011SQL\\u306e\\u30b7\\u30fc\\u30b1\\u30f3\\u30b9\\u3067\\u81ea\\u52d5\\u751f\\u6210\\u3055\\u308c\\u308b\\u30c7\\u30fc\\u30bf\\u3092Entitiy\\u306b\\u683c\\u7d0d\\u3059\\u308b\\u65b9\\u6cd5\",\"author\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/wp-content\\\/uploads\\\/2018\\\/03\\\/mybatis.jpg\",\"width\":259,\"height\":194},\"datePublished\":\"2019-07-15T22:38:15+09:00\",\"dateModified\":\"2020-07-10T17:33:38+09:00\",\"inLanguage\":\"ja\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071#webpage\"},\"articleSection\":\"mybatis, spring, @Options, @SelectKey, mybatis, sequence, spring boot\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com#listItem\",\"position\":1,\"name\":\"\\u30db\\u30fc\\u30e0\",\"item\":\"https:\\\/\\\/ito-u-oti.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=6#listItem\",\"name\":\"\\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=6#listItem\",\"position\":2,\"name\":\"\\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0\",\"item\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=6\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24#listItem\",\"name\":\"spring\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com#listItem\",\"name\":\"\\u30db\\u30fc\\u30e0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24#listItem\",\"position\":3,\"name\":\"spring\",\"item\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071#listItem\",\"name\":\"\\u3010SpringBoot\\u3011\\u3010MyBatis\\u3011SQL\\u306e\\u30b7\\u30fc\\u30b1\\u30f3\\u30b9\\u3067\\u81ea\\u52d5\\u751f\\u6210\\u3055\\u308c\\u308b\\u30c7\\u30fc\\u30bf\\u3092Entitiy\\u306b\\u683c\\u7d0d\\u3059\\u308b\\u65b9\\u6cd5\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=6#listItem\",\"name\":\"\\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071#listItem\",\"position\":4,\"name\":\"\\u3010SpringBoot\\u3011\\u3010MyBatis\\u3011SQL\\u306e\\u30b7\\u30fc\\u30b1\\u30f3\\u30b9\\u3067\\u81ea\\u52d5\\u751f\\u6210\\u3055\\u308c\\u308b\\u30c7\\u30fc\\u30bf\\u3092Entitiy\\u306b\\u683c\\u7d0d\\u3059\\u308b\\u65b9\\u6cd5\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24#listItem\",\"name\":\"spring\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#person\",\"name\":\"\\u3044\\u3068\\u3068\\u3044\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071#personImage\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/wp-content\\\/uploads\\\/2021\\\/06\\\/IMG_20191231_122527_095-150x150.jpg\",\"width\":96,\"height\":96,\"caption\":\"\\u3044\\u3068\\u3068\\u3044\"},\"sameAs\":[\"https:\\\/\\\/twitter.com\\\/itouoti_IoT\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1#author\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1\",\"name\":\"\\u3044\\u3068\\u3068\\u3044\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071#authorImage\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/wp-content\\\/uploads\\\/2021\\\/06\\\/IMG_20191231_122527_095-150x150.jpg\",\"width\":96,\"height\":96,\"caption\":\"\\u3044\\u3068\\u3068\\u3044\"},\"sameAs\":[\"https:\\\/\\\/twitter.com\\\/itouoti_IoT\"]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071#webpage\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071\",\"name\":\"\\u3010SpringBoot\\u3011\\u3010MyBatis\\u3011SQL\\u306e\\u30b7\\u30fc\\u30b1\\u30f3\\u30b9\\u3067\\u81ea\\u52d5\\u751f\\u6210\\u3055\\u308c\\u308b\\u30c7\\u30fc\\u30bf\\u3092Entitiy\\u306b\\u683c\\u7d0d\\u3059\\u308b\\u65b9\\u6cd5 | \\u30f0\\u5200\\u306e\\u304a\\u3082\\u3061\\u3083\\u7bb1\",\"description\":\"SQL\\u306e\\u30b7\\u30fc\\u30b1\\u30f3\\u30b9\\u3092\\u5229\\u7528\\u3057\\u3066\\u3001\\u30c7\\u30fc\\u30bf\\u3092INSERT\\u3059\\u308b\\u6642\\u306b\\u4e3b\\u30ad\\u30fc\\u306a\\u3069\\u3092\\u81ea\\u52d5\\u3067\\u5272\\u308a\\u5f53\\u3066\\u308b\\u3068\\u3044\\u3063\\u305f\\u6642\\u306b\\u3001\\u5272\\u308a\\u5f53\\u3066\\u305f\",\"inLanguage\":\"ja\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/wp-content\\\/uploads\\\/2018\\\/03\\\/mybatis.jpg\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071\\\/#mainImage\",\"width\":259,\"height\":194},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1071#mainImage\"},\"datePublished\":\"2019-07-15T22:38:15+09:00\",\"dateModified\":\"2020-07-10T17:33:38+09:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#website\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/\",\"name\":\"\\u30f0\\u5200\\u306e\\u304a\\u3082\\u3061\\u3083\\u7bb1\",\"description\":\"music\\u00d7IT\\u00d7guiter\\u00d7programing\",\"inLanguage\":\"ja\",\"publisher\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\u3010SpringBoot\u3011\u3010MyBatis\u3011SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092Entitiy\u306b\u683c\u7d0d\u3059\u308b\u65b9\u6cd5 | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","description":"SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u5229\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092INSERT\u3059\u308b\u6642\u306b\u4e3b\u30ad\u30fc\u306a\u3069\u3092\u81ea\u52d5\u3067\u5272\u308a\u5f53\u3066\u308b\u3068\u3044\u3063\u305f\u6642\u306b\u3001\u5272\u308a\u5f53\u3066\u305f","canonical_url":"https:\/\/ito-u-oti.com\/?p=1071","robots":"max-image-preview:large","keywords":"spring boot,mybatis,sequence,@options,@selectkey","webmasterTools":{"google-site-verification":"dHfPMd0QGg17gHdKjRsKPMBchJp5FPXghry3uflwfwM","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ito-u-oti.com\/?p=1071#article","name":"\u3010SpringBoot\u3011\u3010MyBatis\u3011SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092Entitiy\u306b\u683c\u7d0d\u3059\u308b\u65b9\u6cd5 | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","headline":"\u3010SpringBoot\u3011\u3010MyBatis\u3011SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092Entitiy\u306b\u683c\u7d0d\u3059\u308b\u65b9\u6cd5","author":{"@id":"https:\/\/ito-u-oti.com\/?author=1#author"},"publisher":{"@id":"https:\/\/ito-u-oti.com\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2018\/03\/mybatis.jpg","width":259,"height":194},"datePublished":"2019-07-15T22:38:15+09:00","dateModified":"2020-07-10T17:33:38+09:00","inLanguage":"ja","mainEntityOfPage":{"@id":"https:\/\/ito-u-oti.com\/?p=1071#webpage"},"isPartOf":{"@id":"https:\/\/ito-u-oti.com\/?p=1071#webpage"},"articleSection":"mybatis, spring, @Options, @SelectKey, mybatis, sequence, spring boot"},{"@type":"BreadcrumbList","@id":"https:\/\/ito-u-oti.com\/?p=1071#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com#listItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/ito-u-oti.com","nextItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=6#listItem","name":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"}},{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=6#listItem","position":2,"name":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0","item":"https:\/\/ito-u-oti.com\/?cat=6","nextItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=24#listItem","name":"spring"},"previousItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com#listItem","name":"\u30db\u30fc\u30e0"}},{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=24#listItem","position":3,"name":"spring","item":"https:\/\/ito-u-oti.com\/?cat=24","nextItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?p=1071#listItem","name":"\u3010SpringBoot\u3011\u3010MyBatis\u3011SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092Entitiy\u306b\u683c\u7d0d\u3059\u308b\u65b9\u6cd5"},"previousItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=6#listItem","name":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"}},{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?p=1071#listItem","position":4,"name":"\u3010SpringBoot\u3011\u3010MyBatis\u3011SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092Entitiy\u306b\u683c\u7d0d\u3059\u308b\u65b9\u6cd5","previousItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=24#listItem","name":"spring"}}]},{"@type":"Person","@id":"https:\/\/ito-u-oti.com\/#person","name":"\u3044\u3068\u3068\u3044","image":{"@type":"ImageObject","@id":"https:\/\/ito-u-oti.com\/?p=1071#personImage","url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2021\/06\/IMG_20191231_122527_095-150x150.jpg","width":96,"height":96,"caption":"\u3044\u3068\u3068\u3044"},"sameAs":["https:\/\/twitter.com\/itouoti_IoT"]},{"@type":"Person","@id":"https:\/\/ito-u-oti.com\/?author=1#author","url":"https:\/\/ito-u-oti.com\/?author=1","name":"\u3044\u3068\u3068\u3044","image":{"@type":"ImageObject","@id":"https:\/\/ito-u-oti.com\/?p=1071#authorImage","url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2021\/06\/IMG_20191231_122527_095-150x150.jpg","width":96,"height":96,"caption":"\u3044\u3068\u3068\u3044"},"sameAs":["https:\/\/twitter.com\/itouoti_IoT"]},{"@type":"WebPage","@id":"https:\/\/ito-u-oti.com\/?p=1071#webpage","url":"https:\/\/ito-u-oti.com\/?p=1071","name":"\u3010SpringBoot\u3011\u3010MyBatis\u3011SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092Entitiy\u306b\u683c\u7d0d\u3059\u308b\u65b9\u6cd5 | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","description":"SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u5229\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092INSERT\u3059\u308b\u6642\u306b\u4e3b\u30ad\u30fc\u306a\u3069\u3092\u81ea\u52d5\u3067\u5272\u308a\u5f53\u3066\u308b\u3068\u3044\u3063\u305f\u6642\u306b\u3001\u5272\u308a\u5f53\u3066\u305f","inLanguage":"ja","isPartOf":{"@id":"https:\/\/ito-u-oti.com\/#website"},"breadcrumb":{"@id":"https:\/\/ito-u-oti.com\/?p=1071#breadcrumblist"},"author":{"@id":"https:\/\/ito-u-oti.com\/?author=1#author"},"creator":{"@id":"https:\/\/ito-u-oti.com\/?author=1#author"},"image":{"@type":"ImageObject","url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2018\/03\/mybatis.jpg","@id":"https:\/\/ito-u-oti.com\/?p=1071\/#mainImage","width":259,"height":194},"primaryImageOfPage":{"@id":"https:\/\/ito-u-oti.com\/?p=1071#mainImage"},"datePublished":"2019-07-15T22:38:15+09:00","dateModified":"2020-07-10T17:33:38+09:00"},{"@type":"WebSite","@id":"https:\/\/ito-u-oti.com\/#website","url":"https:\/\/ito-u-oti.com\/","name":"\u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","description":"music\u00d7IT\u00d7guiter\u00d7programing","inLanguage":"ja","publisher":{"@id":"https:\/\/ito-u-oti.com\/#person"}}]},"og:locale":"ja_JP","og:site_name":"\u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","og:type":"article","og:title":"\u3010SpringBoot\u3011\u3010MyBatis\u3011SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092Entitiy\u306b\u683c\u7d0d\u3059\u308b\u65b9\u6cd5 | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","og:description":"SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u5229\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092INSERT\u3059\u308b\u6642\u306b\u4e3b\u30ad\u30fc\u306a\u3069\u3092\u81ea\u52d5\u3067\u5272\u308a\u5f53\u3066\u308b\u3068\u3044\u3063\u305f\u6642\u306b\u3001\u5272\u308a\u5f53\u3066\u305f","og:url":"https:\/\/ito-u-oti.com\/?p=1071","og:image":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2018\/03\/mybatis.jpg","og:image:secure_url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2018\/03\/mybatis.jpg","og:image:width":259,"og:image:height":194,"article:published_time":"2019-07-15T13:38:15+00:00","article:modified_time":"2020-07-10T08:33:38+00:00","twitter:card":"summary","twitter:title":"\u3010SpringBoot\u3011\u3010MyBatis\u3011SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3067\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092Entitiy\u306b\u683c\u7d0d\u3059\u308b\u65b9\u6cd5 | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","twitter:description":"SQL\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u5229\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092INSERT\u3059\u308b\u6642\u306b\u4e3b\u30ad\u30fc\u306a\u3069\u3092\u81ea\u52d5\u3067\u5272\u308a\u5f53\u3066\u308b\u3068\u3044\u3063\u305f\u6642\u306b\u3001\u5272\u308a\u5f53\u3066\u305f","twitter:creator":"@itouoti_IoT","twitter:image":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2018\/03\/mybatis.jpg"},"aioseo_meta_data":{"post_id":"1071","title":null,"description":null,"keywords":[{"label":"spring boot","value":"spring boot"},{"label":"mybatis","value":"mybatis"},{"label":"sequence","value":"sequence"},{"label":"@Options","value":"@Options"},{"label":"@SelectKey","value":"@SelectKey"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"article","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-04-11 14:08:05","updated":"2025-06-04 06:03:04","seo_analyzer_scan_date":null},"_links":{"self":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/1071","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1071"}],"version-history":[{"count":3,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/1071\/revisions"}],"predecessor-version":[{"id":1225,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/1071\/revisions\/1225"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/media\/273"}],"wp:attachment":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}