Skip to content

Commit

Permalink
docs: data jpa test
Browse files Browse the repository at this point in the history
  • Loading branch information
shouwn committed Nov 18, 2023
1 parent 5b52d24 commit 2ed0795
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/en/jpql-with-kotlin-jdsl/spring-supports.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ bookRepository.findPage(pageable) {
}
```

{% hint style="info" %}
If you want to use `KotlinJdslJpqlExecutor` in `@DataJpaTest`, you need to import `KotlinJdslAutoConfiguration` directly in the test.
Since `@DataJpaTest` is a slice test, it only creates minimal beans.
And the minimal bean does not include `KotlinJdslAutoConfiguration`.
So if you want to use the features of Kotlin JDSL in `@DataJpaTest`, you need to import `KotlinJdslAutoConfiguration` directly in your test.
{% endhint %}

## Spring Batch

Spring Batch provides `JpaPagingItemReader` and `JpaCursorItemReader` for querying data with JPQL.
Expand Down
6 changes: 6 additions & 0 deletions docs/ko/jpql-with-kotlin-jdsl/spring-supports.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ bookRepository.findPage(pageable) {
}
```

{% hint style="info" %}
만약 `KotlinJdslJpqlExecutor``@DataJpaTest`에서 사용하고 싶다면 `KotlinJdslAutoConfiguration`를 테스트에서 직접 import 해야 합니다.
`@DataJpaTest`는 slice test이기 때문에 최소한의 bean만 생성합니다. 그리고 이 bean에는 `KotlinJdslAutoConfiguration`이 포함되어 있지 않습니다.
그래서 `@DataJpaTest`에서 Kotlin JDSL의 기능을 사용하고 싶다면 테스트에서 `KotlinJdslAutoConfiguration`를 직접 import 해야 합니다.
{% endhint %}

## Spring Batch

SpringBatch는 JPQL로 쿼리를 할 수 있도록 `JpaPagingItemReader``JpaCursorItemReader`를 제공합니다.
Expand Down

0 comments on commit 2ed0795

Please sign in to comment.