inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

실전! Querydsl

Querydsl 사용 중 오류

해결된 질문

595

dop

작성한 질문수 1

0

query dsl  사용중에  다음과 같은 오류가 발생했습니다. 

오류 1 . DataJpaTest org.hibernate.PersistentObjectException: detached entity passed to persist:

오류 2. JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate. Use build process "jps.track.ap.dependencies" VM flag to enable/disable incremental annotation processing environment.

Annotation Processer는 체크되어있는 상태입니다.  lombok을 최신버전으로 명시해줘도 해결되지 않았습니다.

하나의 dependency를 추가하면 정상 실행되는 이상한 현상(?)이 발생했습니다. 추가한 dependency를 삭제하면 여전히 실행되지 않았구요.  (특정 dependency가 아니라 무엇이든 상관없었습니다.)

=> 질문을 올린 이후에  gradlew clean / build로 해결하였습니다.

저와 같은 현상을 겪는 분들이 많은 것 같아 질문은 삭제하지 않고 남겨두도록 하겠습니다.

<gradle 파일> (일부러 h2 부분 주석처리 해놓았습니다.)

plugins {
id 'org.springframework.boot' version '2.4.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
id "io.franzbecker.gradle-lombok" version "3.0.0"
}

group = 'ShallWe'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
}

dependencies {
implementation 'junit:junit:4.12'
compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.querydsl:querydsl-jpa'

compileOnly 'org.projectlombok:lombok'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
// runtimeOnly 'com.h2database:h2'

annotationProcessor 'org.projectlombok:lombok'
// testImplementation 'org.springframework.security:spring-security-test'
implementation('org.springframework.boot:spring-boot-starter-validation')
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}

test {
useJUnitPlatform()
}

//querydsl 추가 시작
def querydslDir = "$buildDir/generated/querydsl"

querydsl {
jpa = true
querydslSourcesDir = querydslDir
}
sourceSets {
main.java.srcDir querydslDir
}
configurations {
querydsl.extendsFrom compileClasspath
}
compileQuerydsl {
options.annotationProcessorPath = configurations.querydsl
}

<application.yml>

spring:
output:
ansi:
enabled: always
datasource:
url: jdbc:mariadb://localhost:3306/shallwetest?useUnicode=true&characterEncoding=utf-8
username: username
password: password
driver-class-name: org.mariadb.jdbc.Driver
jpa:
hibernate:
ddl-auto: update #create , create-drop , update , validate, none
properties:
hibernate:
show_sql: true
format_sql: true

java JPA

답변 1

0

김영한

dop님 감사합니다.

SpringBoot 4.X에서의 Querydsl 설정

0

63

2

querydsl 오픈소스에 대한 질문

0

65

1

예제에서의 카운트 쿼리에서 join문과 where문은 필요없지 않나요?

0

105

1

Querydsl 6.X버전에 대해서 어떻게 생각하시나요?

0

309

2

여러 테이블 조인하여 통계치를 구하고자 할 때 어떤 방법이 더 효율적일까요

1

67

1

fetchResults()는 더이상 권장되지 않는다는데 맞나요?

0

158

1

querydsl sum() 메서드 없어요.

0

156

2

build 디렉터리 생성

0

133

2

자바 ORM 표준 JPA 프로그래밍 - 기본편 듣고 바로 학습해도 괜찮을까요?

0

111

2

현재 Querydsl에서 from절 서브쿼리를 지원하나요?

0

87

1

오타 제보 드립니다.

0

68

2

벌크 연산과 flush, clear

0

75

1

Run As Intellij 로 변경시 Q타입 import 불가

0

84

1

QHello import하기 문제 발생

0

146

2

등록된 함수 보는법(H2Dialect) 질문

0

67

2

5.0부터 Querydsl은 향후 fetchCount() , fetchResult() 를 지원하지 않기로 결정했다고 하는데 이에 맞는 강의

1

189

2

[환경설정 PDF 부트 3.0이후 설명 질문] build.gradle에 compileQuerydsl을 정의하지 않은 상태에서 Gradle->Tasks->other->compileQuerydsl을 클릭하라고 하는 이유가 무엇인가요??

1

195

1

querydsl 설정 문제

0

220

2

quey dsl 설정부분

0

155

2

count 쿼리 관련 질문입니다!

0

73

1

stringtemplate를 이용하여 where절 검색 방법 질문 드립니다.

0

89

1

답변부탁드리겠습니다.

0

88

2

(OrderSpecifier)관련 내용 어디있을가요

0

60

1

중급문법 벌크연산에서

0

77

2