post-custom-banner

πŸ”— Preferences μ„€μ •
πŸ”— aplication.yml - H2 , JPA , Logging μ„€μ •
πŸ”— aplication.yml - My SQL , JAP , Thymeleaf μ„€μ •

✏️ Project 생성

πŸ”— Project 생성 링크

πŸ“ Dependencies


✏️ AssertJ import

  • dependencies 에 μΆ”κ°€ν•΄μ£Όλ©΄ λœλ‹€.
testImplementation "org.assertj:assertj-core:3.20.2"

✏️ QueryDSL μ„€μ •

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-web'
	//JPA, μŠ€ν”„λ§ 데이터 JPA μΆ”κ°€
	implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
	//Querydsl μΆ”κ°€
	implementation 'com.querydsl:querydsl-jpa'
	annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa"
	annotationProcessor "jakarta.annotation:jakarta.annotation-api"
	annotationProcessor "jakarta.persistence:jakarta.persistence-api"
	//H2 λ°μ΄ν„°λ² μ΄μŠ€ μΆ”κ°€
	runtimeOnly 'com.h2database:h2'
	compileOnly 'org.projectlombok:lombok'
	annotationProcessor 'org.projectlombok:lombok'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
    // νƒ€μž„λ¦¬ν”„ νƒ¬ν”Œλ¦Ώ μ‚¬μš©
    implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' 
	//ν…ŒμŠ€νŠΈμ—μ„œ lombok μ‚¬μš©
	testCompileOnly 'org.projectlombok:lombok'
	testAnnotationProcessor 'org.projectlombok:lombok'
}

tasks.named('test') {
	useJUnitPlatform()
}

//Querydsl μΆ”κ°€, μžλ™ μƒμ„±λœ Q클래슀 gradle clean으둜 제거
clean {
	delete file('src/main/generated')
}

πŸ“ Q Type 생성

πŸ”— Q Type

  • Entity λ₯Ό μƒμ„±ν•˜λ©΄ ν•„λ“œλ₯Ό 기반으둜 Q Type 이 μƒμ„±λœλ‹€.
    • application μ‹€ν–‰ν•΄μ„œ μƒμ„±ν•˜κΈ°
    • build 의 Rebuild (S + C + F9) 둜 μƒμ„±ν•˜κΈ°

❗️ generated λŠ” git ignore 둜 repository 에 μ—…λ‘œλ“œκ°€ μ•ˆλ˜κ²Œ 막아주어야 ν•œλ‹€.

profile
잘λͺ»λœ λ‚΄μš© PR ν™˜μ˜
post-custom-banner

0개의 λŒ“κΈ€