{"id":185,"date":"2023-06-22T20:38:58","date_gmt":"2023-06-22T12:38:58","guid":{"rendered":"http:\/\/blog.ohmmx.com\/?p=185"},"modified":"2023-06-22T20:38:58","modified_gmt":"2023-06-22T12:38:58","slug":"hibernate%e5%91%bd%e5%90%8d%e7%ad%96%e7%95%a5%ef%bc%9a%e7%89%a9%e7%90%86%e5%90%8d%e7%a7%b0","status":"publish","type":"post","link":"http:\/\/blog.ohmmx.com\/?p=185","title":{"rendered":"Hibernate\u547d\u540d\u7b56\u7565\uff1a\u7269\u7406\u540d\u79f0"},"content":{"rendered":"\n<p>\u5728 Spring Boot \u5f00\u542f\u81ea\u52a8\u66f4\u65b0\u6570\u636e\u5e93\u65f6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>spring.jpa.hibernate.ddl-auto: update<\/code><\/pre>\n\n\n\n<p>Spring Boot \u914d\u7f6e\u9879\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>spring.jpa.hibernate.naming.physical-strategy<\/code><\/pre>\n\n\n\n<p>\u8be5\u914d\u7f6e\u9879\u67092\u4e2a\u503c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl<\/code><\/pre>\n\n\n\n<p>\u548c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy (spring boot 2.6.0 \u4e4b\u524d)\norg.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy (spring boot 2.6.0\u542b \u4e4b\u540e)<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u4e24\u7c7b\u90fd\u662f\u5b9e\u73b0\u4e86<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>org.hibernate.boot.model.naming.PhysicalNamingStrategy<\/code><\/pre>\n\n\n\n<p>\u5176\u4e2d\u524d\u8005 PhysicalNamingStrategyStandardImpl \u4e3a\u76f4\u63a5\u6620\u5c04\u8868\u540d\u548c\u5b57\u6bb5\u540d<\/p>\n\n\n\n<p>\u5728\u6709\u6ce8\u89e3@Table\u548c@Column\u65f6\uff0c\u8868\u540d\u548c\u5b57\u6bb5\u540d\u4e3a\u8bbe\u7f6e\u7684\u540d\u79f0\u3002\u6ca1\u6709\u914d\u7f6e\u65f6\uff0c\u8868\u540d\u4e3a\u7c7b\u540d\uff0c\u5b57\u6bb5\u540d\u4e3a\u7c7b\u7684\u5b57\u6bb5\u540d\u3002<\/p>\n\n\n\n<p>\u540e\u8005 CamelCaseToUnderscoresNamingStrategy \u4e3a\u9a7c\u5cf0\u547d\u540d\uff0c\u8868\u540d\u548c\u5b57\u6bb5\u540d\u5728\u6709\u5927\u5199\u5b57\u6bcd\u7684\u60c5\u51b5\u4e0b\u4f1a\u5728\u6570\u636e\u5e93\u81ea\u52a8\u8f6c\u6362\u4e3a\u4e0b\u5212\u7ebf \u201c_\u201d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Spring Boot \u5f00\u542f\u81ea\u52a8\u66f4\u65b0\u6570\u636e\u5e93\u65f6\uff1a Spring Boot \u914d\u7f6e &hellip; <a href=\"http:\/\/blog.ohmmx.com\/?p=185\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35,17],"tags":[36,8],"class_list":["post-185","post","type-post","status-publish","format-standard","hentry","category-java","category-17","tag-java","tag-8"],"_links":{"self":[{"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=\/wp\/v2\/posts\/185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=185"}],"version-history":[{"count":1,"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=\/wp\/v2\/posts\/185\/revisions"}],"predecessor-version":[{"id":186,"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=\/wp\/v2\/posts\/185\/revisions\/186"}],"wp:attachment":[{"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ohmmx.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}