[Spring boot] JPA yaml 세팅

유존돌돌이·2022년 2월 17일
0

Spring boot

목록 보기
6/20
post-thumbnail
  jpa:
    open-in-view: true
    hibernate:
      # create : 하면 프로젝트 실행할때마다 재생성 (운영에서 절대 X)
      # update : 프로젝트 실행할때 alter
      ddl-auto: create
      naming:
       # PhysicalNamingStrategyStandardImpl : 내가 지정한 필드명 그대로 사용한다.
       # SpringPhysicalNamingStrategy : 자동으로 내가 지정한 필드를 CamelToe에서 언더바 명명으로 바꿔준다 (emailName->email_name)
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
      # JPA의 기본 넘버링 strategy를 따라가지 않고 연결된 DB의 넘버링을 선택한다 (False)        
      use-new-id-generator-mappings: false
    # console 창에 보여준다 true
    show-sql: true
    properties:
      # console 창에 query보여줄 때 이쁘게 보여준 true
      hibernate.format_sql: true
  1. ddl-auto
    1) create : 하면 프로젝트 실행할때마다 재생성 (운영에서 절대 X)
    2) update : 프로젝트 실행할때 alter

  2. naming
    1) PhysicalNamingStrategyStandardImpl : 내가 지정한 필드명 그대로 사용한다.
    2) SpringPhysicalNamingStrategy : 자동으로 내가 지정한 필드를 CamelToe에서 언더바 명명으로 바꿔준다 (emailName->email_name)

  3. use-new-id-generator-mappings
    1) false : JPA의 룰을 따르지 않는다.
    1) true : JPA의 룰을 따른다.

0개의 댓글