꼬물꼬물
[18강] User 테이블 생성 본문
@Entity는 table을 가리킨다.
@Id @GerneratedValue @Column @ColumnDefault @CreationTimestamp
테이블이 이미 존재해도 프로젝트 실행마다 새로 만들겠다.
나중에는 update로 설정해야 한다.
ctrl+alt+delete의 작업 관리자에서 MySQL80이 돌고 있는 것을 확인한 후, 프로젝트 실행
application.yml
server:
port: 8000
servlet:
context-path: /blog
encoding:
charset: UTF-8
enabled: true
force: true
spring:
mvc:
view:
prefix: /WEB-INF/views/
suffix: .jsp
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/blog?serverTimezone=Asia/Seoul
username: cos
password: cos1234
jpa:
open-in-view: true
hibernate:
ddl-auto: create
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
use-new-id-generator-mappings: false
show-sql: true
properties:
hibernate.format_sql: true
jackson:
serialization:
fail-on-empty-beans: false
// JPA == ORM
// ORM -> JAVA(다른언어) Object를 테이블로 매핑해주는 기술
'코딩 > Blog' 카테고리의 다른 글
[21~3 강] 연관관계 주인 (0) | 2022.01.20 |
---|---|
[20강] Board, Reply 테이블 생성 (0) | 2022.01.20 |
[17강] Yaml/Yml 설정 (0) | 2022.01.20 |
[16강] Lombok (0) | 2022.01.20 |
[13강] http 요청 (0) | 2022.01.19 |