Last change
on this file since b2e6513 was ce6ad22, checked in by DavidTrajkovski <davidtrajkovski11@…>, 3 years ago |
v1 initial prototype
|
-
Property mode
set to
100644
|
File size:
797 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.Administrator;
|
---|
9 |
|
---|
10 | import javax.transaction.Transactional;
|
---|
11 |
|
---|
12 | @Repository
|
---|
13 | public interface AdministratorRepository extends JpaRepository<Administrator, Integer> {
|
---|
14 |
|
---|
15 | Administrator findByAdministratorId(int id);
|
---|
16 |
|
---|
17 | void deleteByAdministratorId(int id);
|
---|
18 |
|
---|
19 | Optional<Administrator> findAdministratorByEmail(String email);
|
---|
20 |
|
---|
21 | @Transactional
|
---|
22 | @Modifying
|
---|
23 | @Query("UPDATE Administrator a " +
|
---|
24 | "SET a.enabled = TRUE WHERE a.email = ?1")
|
---|
25 | int enableAdministrator(String email);
|
---|
26 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.