[Spring JPA] JPQL DELETE ENTITY with JOINs using JPA / SQL DELETE with join condition
2022. 5. 24. 22:42
반응형
jpql delete query with join condition
DELETE FROM Post p
WHERE p IN
(SELECT post FROM Project project
JOIN project.posts post
WHERE project.id = post.project.id)
sql delete query with join condition
DELETE posts
FROM posts
INNER JOIN projects ON projects.project_id = posts.project_id
WHERE projects.client_id = :client_id
728x90
반응형
'web > Spring' 카테고리의 다른 글
[Spring JPA] Dirty Checking(더티체킹)이란? (0) | 2022.05.26 |
---|---|
[Spring JPA] @Modifying 어노테이션 (1) | 2022.05.25 |
[Spring JPA] 대량의 데이터를 삭제할 때 batch delete query (0) | 2022.05.23 |
[Spring] @RequestBody vs @ModelAttribute (0) | 2022.04.21 |
[Spring MVC] Handler Method 핸들러 메서드 @ModelAttribute (0) | 2022.04.20 |
Written by ner.o
개발자 네로의 개발 일기,
자바를 좋아합니다 !
댓글 개