build.gradle
dependencies {
//thymeleaf ๋ผ์ด๋ธ๋ฌ๋ฆฌ
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
// implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6:3.1.1.RELEASE'
//sprinng security ๋ผ์ด๋ธ๋ฌ๋ฆฌ
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'
//Spring Starter Web :MVC ๋ชจ๋ธ ๊ฐ๋ฐ ์ ํ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
implementation 'org.springframework.boot:spring-boot-starter-web'
//lombok ๋ผ์ด๋ธ๋ฌ๋ฆฌ
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
//devtools ๋ผ์ด๋ธ๋ฌ๋ฆฌ (์์ ์ฌํญ ๋ฐ์ ์๋ restart)
developmentOnly 'org.springframework.boot:spring-boot-devtools'
//Test ๋ผ์ด๋ธ๋ฌ๋ฆฌ
testImplementation 'org.springframework.boot:spring-boot-starter-test'
//๋งํฌ๋ค์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น (2์ 17์ผ) - ๋งํฌ๋ค์ด : github์ readme.md์ ์ ์ฌํ ์ฌ์ฉ
implementation 'org.commonmark:commonmark:0.21.0'
//JPA ๋ผ์ด๋ธ๋ฌ๋ฆฌ
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
// QueryDSL
implementation 'com.querydsl:querydsl-jpa:5.0.0'
implementation 'com.querydsl:querydsl-apt:5.0.0'
implementation 'com.querydsl:querydsl-core:5.0.0' // ํ๊ฐ ๋ ์ถ๊ฐ!
//oracle ๋ผ์ด๋ธ๋ฌ๋ฆฌ
//implementation 'com.oracle.database.jdbc:ojdbc10'
implementation 'com.oracle.database.jdbc:ojdbc11'
//JDBC
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
//javax : spring boot 2.3 ์ด์์์ ์ฌ์ฉ ์ค์
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: '2.5.4'
//model mapper
implementation group: 'org.modelmapper', name: 'modelmapper', version: '2.3.9'
}
application.properties
#์ฝ๋ ๋ค ๊ณต๋ฐฑ ์๋๋ก ์ ์
# ์๋ฒ ํฌํธ ์ค์
server.port=9494
#ํ๋ก์ ํธ ์ด๋ฆ ์ง์
spring.application.name=shop
# DevTools ํ์ฑํ
spring.devtools.livereload.enabled=true
spring.freemarker.cache=false
# JPA ( JPA๋ H2 DB์ ์ฐ๊ฒฐ ์ค์ , ๋ณ๊ฒฝ์ฌํญ๋ง ์
๋ฐ์ดํธ๋จ)
# ๋ฐฐํฌ์์๋ none / validate (update = ๊ฐ๋ฐ ์ ์ฌ์ฉ)
spring.jpa.hibernate.ddl-auto=update
# JPA ๋ฉ์๋๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ JPA๊ฐ SQL ์ฟผ๋ฆฌ๋ฅผ ์์ฑํด์ DB์ ์ ์ฅ ํจ.
# ( Oracle, MySQL, MSSQL...) ์ฟผ๋ฆฌ ๋ด์ฉ์ด ์ฝ์์ ์ถ๋ ฅ ๋๋๋ก ์ค์
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.show_sql=true
# Orale DB ์ฐ๊ฒฐ
# spring.datasource.url=jdbc:oracle:thin:@localhost:1521:xe
spring.datasource.url=jdbc:oracle:thin:@localhost:1521:xe
spring.datasource.username=C##shop
spring.datasource.password=1234
spring.datasource.driverClassName=oracle.jdbc.driver.OracleDriver
spring.jpa.database=oracle
spring.jpa.database-platform=org.hibernate.dialect.OracleDialect
#์ฟผ๋ฆฌ์ ๋ฌผ์ํ๋ก ์ถ๋ ฅ๋๋ ๋ฐ์ธ๋ ํ๋ผ๋ฏธํฐ ์ถ๋ ฅ(?, ?, ?, ?)
logging.level.org.hibernate.type.descriptor.sql=trace
#Thymeleaf cache ์ฌ์ฉ ์ค์ง
spring.thymeleaf.cache = false
#ํ์ผ ํ ๊ฐ๋น ์ต๋ ์ฌ์ด์ฆ
spring.servlet.multipart.maxFileSize=20MB
#์์ฒญ๋น ์ต๋ ํ์ผ ํฌ๊ธฐ
spring.servlet.multipart.maxRequestSize=100MB
#์ํ ์ด๋ฏธ์ง ์
๋ก๋ ๊ฒฝ๋ก ์ง์
itemImgLocation=C:/shop/item
#๋ฆฌ์์ค ์
๋ก๋ ๊ฒฝ๋ก์ง์
uploadPath=file:///C:/shop/
#๊ธฐ๋ณธ batch size ์ค์
spring.jpa.properties.hibernate.default_batch_fetch_size=1000
Oracle
# ๊ณ์ ์์ฑ
create user C##shop identified by 1234;
# HR ๊ณ์ ์ ๊ถํ ๋ถ์ฌ
grant connect, resource to C##shop;
# ํ
์ด๋ธ ์คํ์ด์ค ์ฌ์ฉ ๊ถํ ๋ถ์ฌ
alter user C##shop quota unlimited on USERS;