{"id":1597,"date":"2019-07-22T20:10:47","date_gmt":"2019-07-22T11:10:47","guid":{"rendered":"https:\/\/esoro.jp\/?p=1597"},"modified":"2019-07-22T20:10:47","modified_gmt":"2019-07-22T11:10:47","slug":"mybatis%e8%87%aa%e5%8b%95%e7%94%9f%e6%88%90sql%e3%81%8b%e3%82%89%e3%82%b9%e3%82%ad%e3%83%bc%e3%83%9e%e5%90%8d%e3%82%92%e9%99%a4%e5%a4%96","status":"publish","type":"post","link":"https:\/\/esoro.jp\/?p=1597","title":{"rendered":"Mybatis\u81ea\u52d5\u751f\u6210SQL\u304b\u3089\u30b9\u30ad\u30fc\u30de\u540d\u3092\u9664\u5916"},"content":{"rendered":"<p>\u3000\u65e2\u5b58\u306eWeb\u30b5\u30fc\u30d3\u30b9\u3092\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3057\u3088\u3046\u3068\u3044\u3046\u4e8b\u3067\u3001Springboot\uff06Mybatis3\u3067\u5b9f\u88c5\u3092\u958b\u59cb\u3057\u3001\u958b\u767a\u7aef\u672b\u4e0a\u306eOracleDB\u306b\u63a5\u7d9a\u3057\u3066Mybatis\u306e\u81ea\u52d5\u751f\u6210\u6a5f\u80fd\u3092\u4f7f\u7528\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3000\u304b\u306a\u308a\u4fbf\u5229\u3067\u3001\u7c21\u5358\u306aSQL\u3067\u6e08\u3080\u7bc4\u56f2\u306a\u3089SQL\u3092\u66f8\u304f\u5fc5\u8981\u304c\u7121\u3044\u3088\u3046\u3067\u3059\u3002\u304c\u3001\u81ea\u52d5\u751f\u6210\u3055\u308c\u305fxml\u3092\u898b\u3066\u307f\u308b\u3068\u3001SQL\u5185\u306e\u30c6\u30fc\u30d6\u30eb\u540d\u306b\u30b9\u30ad\u30fc\u30de\u540d\u304c\u4ed8\u52a0\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u3002<br \/>\n\u3000\u5b9f\u969b\u306b\u4f7f\u7528\u3059\u308b\u30b5\u30fc\u30d0\u4e0a\u306eDB\u306f\u3069\u3093\u306a\u30b9\u30ad\u30fc\u30de\u540d\u306b\u306a\u308b\u304b\u73fe\u6bb5\u968e\u3067\u306f\u89e3\u3089\u306a\u3044\u3057\u3001\u30b9\u30ad\u30fc\u30de\u540d\u3092\u30ab\u30c3\u30c8\u3057\u3066\u304f\u308c\u308b\u8a2d\u5b9a\u304c\u7121\u3044\u304b\u3001\u4e0b\u8a18\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.mybatis.org\/generator\/configreference\/table.html\">http:\/\/www.mybatis.org\/generator\/configreference\/table.html<\/a><\/p>\n<p>\u305d\u308c\u3063\u307d\u3044\u306e\u3092\u4f55\u500b\u304b\u8a66\u3057\u3066\u3001\u7d50\u679c\u3001ignoreQualifiersAtRuntime \u3092\u3064\u3051\u308b\u4e8b\u3067sqlMap.xml\u306b\u81ea\u52d5\u751f\u6210\u3055\u308c\u308bSQL\u304b\u3089\u30b9\u30ad\u30fc\u30de\u540d\u304c\u7121\u304f\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"lang:xhtml decode:true \" title=\"generatorConfig.xml\" >&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;\r\n&lt;!DOCTYPE generatorConfiguration PUBLIC \"-\/\/mybatis.org\/\/DTD MyBatis Generator Configuration 1.0\/\/EN\" \"http:\/\/mybatis.org\/dtd\/mybatis-generator-config_1_0.dtd\" &gt;\r\n&lt;generatorConfiguration&gt;\r\n    &lt;context id=\"MyDb\" targetRuntime=\"MyBatis3\"&gt;\r\n \r\n        &lt;!-- \u30b9\u30ad\u30fc\u30de\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b DB \u3078\u306e\u63a5\u7d9a\u8a2d\u5b9a --&gt;\r\n        &lt;jdbcConnection\r\n            driverClass=\"oracle.jdbc.driver.OracleDriver\"\r\n            connectionURL=\"jdbc:oracle:thin:@localhost:1521\/dev.local\"\r\n            userId=\"testdb\"\r\n            password=\"password\"\r\n        \/&gt;\r\n        &lt;!-- javaModelGenerator\u7b49\u306f\u5272\u611b --&gt;\r\n        \r\n        &lt;table schema=\"testdb\" tableName=\"%\"&gt; \r\n            &lt;property name=\"ignoreQualifiersAtRuntime\" value=\"true\" \/&gt;\r\n        &lt;\/table&gt;\r\n    &lt;\/context&gt;\r\n&lt;\/generatorConfiguration&gt;<\/pre>\n<p>\u3067\u3082\u3001\u65e2\u5b58\u30b7\u30b9\u30c6\u30e0\u306f\u304b\u306a\u308a\u8907\u96d1\u306aSQL\u304c\u591a\u6570\u6709\u308a\u3001DB\u8a2d\u8a08\u306f\u305d\u306e\u307e\u307e\u3068\u306a\u308b\u3068\u3001\u81ea\u52d5\u751f\u6210\u306e\u6069\u6075\u3082\u4e00\u90e8\u306e\u9650\u3089\u308c\u305f\u7bc4\u56f2\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u65e2\u5b58\u306eWeb\u30b5\u30fc\u30d3\u30b9\u3092\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3057\u3088\u3046\u3068\u3044\u3046\u4e8b\u3067\u3001Springboot\uff06 &hellip; <a href=\"https:\/\/esoro.jp\/?p=1597\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/posts\/1597"}],"collection":[{"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/esoro.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1597"}],"version-history":[{"count":0,"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/posts\/1597\/revisions"}],"wp:attachment":[{"href":"https:\/\/esoro.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/esoro.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/esoro.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}