{"id":244,"date":"2017-11-05T23:13:00","date_gmt":"2017-11-05T15:13:00","guid":{"rendered":"https:\/\/cn1.club\/?p=244"},"modified":"2025-03-15T21:58:07","modified_gmt":"2025-03-15T13:58:07","slug":"spring-data-jpa%e6%95%b4%e5%90%88mysql%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/cn1.club\/?p=244","title":{"rendered":"Spring Data JPA\u6574\u5408MySql\u914d\u7f6e"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >applicationContext.xml \u6587\u4ef6\u4e2d:\n\t\t&lt;property name=&quot;jpaVendorAdapter&quot;&gt;\n\t\t\t&lt;bean class=&quot;org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter&quot;&gt;\n\t\t\t\t&lt;property name=&quot;generateDdl&quot; value=&quot;true&quot; \/&gt;\n\t\t\t\t&lt;property name=&quot;database&quot; value=&quot;ORACLE&quot; \/&gt;\n\t\t\t\t&lt;property name=&quot;databasePlatform&quot; value=&quot;org.hibernate.dialect.Oracle10gDialect&quot; \/&gt;\n\t\t\t\t&lt;property name=&quot;showSql&quot; value=&quot;true&quot; \/&gt;\n\t\t\t&lt;\/bean&gt;\n\t\t&lt;\/property&gt;\n \n\u5176\u4e2d generateDdl\u4e3atrue\u65f6\u6570\u636e\u5e93\u81ea\u52a8\u6839\u636e\u5b9e\u4f53\u751f\u6210,\u4e3afalse\u65f6\u4e0d\u81ea\u52a8\u751f\u6210\n\u5176\u4e2ddatabase\u4e3a\u6570\u636e\u5e93\u7c7b\u578b, \u4ee5\u4e0a\u4e3aORACLE, \u5982\u679c\u4e3aMySql\u65f6 \u4e3a MYSQL\n\u5176\u4e2ddatabasePlatform \u4e3ahibernate\u6570\u636e\u5e93\u65b9\u8a00, \u5982\u679c\u4f7f\u7528OORACLE\u65f6\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0a\u914d\u7f6e,\u4f7f\u7528MySQL\u65f6,\u4e3a:\n \norg.hibernate.dialect.MySQL5InnoDBDialect\n \n\n\n\u7136\u540e\u914d\u7f6e\u6570\u636e\u5e93\u7684\u8fde\u63a5\u914d\u7f6e:\n\n\u6570\u636e\u5e93\u5730\u5740:\u7aef\u53e3\/\u6570\u636e\u5e93\u540d\n\njdbc.url = jdbc:mysql:\/\/127.0.0.1:3306\/weyu\n jdbc.driver= com.mysql.jdbc.Driver\n jdbc.user = root\n jdbc.password = root<\/code><\/pre>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":196,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"class_list":["post-244","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-xuexi"],"_links":{"self":[{"href":"https:\/\/cn1.club\/index.php?rest_route=\/wp\/v2\/posts\/244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn1.club\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn1.club\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn1.club\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn1.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=244"}],"version-history":[{"count":0,"href":"https:\/\/cn1.club\/index.php?rest_route=\/wp\/v2\/posts\/244\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cn1.club\/index.php?rest_route=\/wp\/v2\/media\/196"}],"wp:attachment":[{"href":"https:\/\/cn1.club\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn1.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn1.club\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}