[Chapter 08] Spring Data JPA 메서드 네이밍 룰 #103
Unanswered
JoisFe
asked this question in
Chapter 08. Data Persistence
Replies: 1 comment 1 reply
-
책 설명이 오류로 보입니다. (cf. Query Creation) public interface HotelRepository extends JpaRepository<HotelEntity, Long> {
// (x)
void deleteByStatusInAndCreatedAtBetweenAndNameIsNull(HotelStatus status, ZonedDateTime beingCreatedAt, ZonedDateTime endCreatedAt);
// (o)
void deleteByStatusInAndCreatedAtBetweenAndNameIsNull(Collection<HotelStatus> statuses, ZonedDateTime beingCreatedAt, ZonedDateTime endCreatedAt);
} 검수를 어떻게 했는지 모르겠지만... 하나 생각나는 문장이 있네요.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
[Chapter 08] Spring Data JPA 메서드 네이밍 룰
책 734, 735 pg를 보면 쿼리 메서드에서 조합할 수 있는 키워드가 나옵니다.
거기서
In
키워드 예시를 보면--> 이 경우 해당 조건 절이
where status in (?, ?, ..., ?)
라고 하였습니다.그런데 다른 예시를 보면
--> 이 경우 해당 조건 절이
WHERE status = :status AND created_at Between :beginCreatedAt and :endCreatedAt AND name is null
조건문이 status를
in
이 아닌 단순히 같은지 비교를 하고 있습니다.그래서 설명한 키워드와 맞지 않은 것 같은데 제가 잘못 이해한 부분을 설명해주시면 감사하겠습니다.
Beta Was this translation helpful? Give feedback.
All reactions