Last change
on this file since c45b67b was 9dd526f, checked in by andrejTavchioski <andrej.tavchioski@…>, 3 years ago |
backend refactoring
|
-
Property mode
set to
100644
|
File size:
810 bytes
|
Line | |
---|
1 | package parkup.repositories;
|
---|
2 |
|
---|
3 | import java.util.Optional;
|
---|
4 | import org.springframework.data.jpa.repository.JpaRepository;
|
---|
5 | import org.springframework.data.jpa.repository.Modifying;
|
---|
6 | import org.springframework.data.jpa.repository.Query;
|
---|
7 | import org.springframework.stereotype.Repository;
|
---|
8 | import parkup.entities.RegisteredUser;
|
---|
9 |
|
---|
10 | import javax.transaction.Transactional;
|
---|
11 |
|
---|
12 | @Repository
|
---|
13 | public interface RegisteredUserRepository extends JpaRepository<RegisteredUser, Integer> {
|
---|
14 | RegisteredUser findByRegParkId(int regParkId);
|
---|
15 |
|
---|
16 | void deleteByRegParkId(int regParkId);
|
---|
17 |
|
---|
18 | Optional<RegisteredUser> findRegisteredUserByEmail(String email);
|
---|
19 |
|
---|
20 | @Transactional
|
---|
21 | @Modifying
|
---|
22 | @Query("UPDATE RegisteredUser rp " +
|
---|
23 | "SET rp.enabled = TRUE WHERE rp.email = ?1")
|
---|
24 | int enableRegisteredUser(String email);
|
---|
25 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.