본문 바로가기

스프링 부트3

Kotlin으로 Spring Boot JPA 프로젝트에 Querydsl 적용하기 코드 작성 과정과 방법은 모두 https://jojoldu.tistory.com/372에서 참조하였다. build.gradle.kts build.gradle.kts에서 Querydsl을 사용하기 위한 gradle 설정을 추가한다. apply(plugin = "kotlin-kapt") apply(plugin = "kotlin-jpa") sourceSets["main"].withConvention(KotlinSourceSet::class) { kotlin.srcDir("$buildDir/generated/source/kapt/main") } dependencies { kapt("org.springframework.boot:spring-boot-configuration-processor") compile("c.. 2019. 10. 1.
Wiring in Spring (@Resource, @Inject, @Autowired 차이) Spring Framework에는 의존성 주입과 관련된 annotation @Resource, @Inject, @Autowired가 있다. 모두 setter와 field에서 사용할 수 있다. @Resource Match by Name Match by Type Match by Qualifier 위 우선순위대로 의존성이 주입된다. @Inject Match by Type Match by Qualifier Match by Name 위 우선순위대로 의존성이 주입된다. @Inject annotaion을 사용하려면 Gradle 또는 Maven에서 javax.inject 라이브러리를 사용하도록 설정해야 한다. @Autowired Match by Type Match by Qualifier Match by Name 의존성.. 2019. 9. 15.
[Spring Boot/JPA] hibernate.ddl-auto 옵션으로 서버를 실행할 때마다 DB 초기화하기 JPA로 DB를 초기화하는 방법은 두 가지가 있다. spring.jpa.generate-ddl (boolean) switches the feature on and off and is vendor independent. spring.jpa.hibernate.ddl-auto (enum) is a Hibernate feature that controls the behavior in a more fine-grained way. This feature is described in more detail later in this guide. 여기서 2. spring.jpa.hibernate.ddl-auto를 통해 DB 초기화 전략을 만들 때 사용할 수 있는 옵션 값은 none, update, validata, cre.. 2019. 9. 13.