-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb1cdc6
commit 3cfa385
Showing
2 changed files
with
14 additions
and
6 deletions.
There are no files selected for viewing
13 changes: 9 additions & 4 deletions
13
src/main/java/com/github/nhatoriginal/spring/repository/UserRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
package com.github.nhatoriginal.spring.repository; | ||
|
||
import com.github.nhatoriginal.spring.model.User; | ||
import com.google.googlejavaformat.Op; | ||
|
||
import jakarta.transaction.Transactional; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Modifying; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.UUID; | ||
|
||
public interface UserRepository extends JpaRepository<User, UUID> { | ||
|
||
User findByEmail(String email); | ||
|
||
@Modifying | ||
@Transactional | ||
@Query(value = "DELETE FROM user_addresses WHERE address_id = :addressId", nativeQuery = true) | ||
void deleteUserAddressesByAddressId(UUID addressId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters