Last change
on this file since b2e6513 was 9dd526f, checked in by andrejTavchioski <andrej.tavchioski@…>, 3 years ago |
backend refactoring
|
-
Property mode
set to
100644
|
File size:
727 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.Worker;
|
---|
9 |
|
---|
10 | import javax.transaction.Transactional;
|
---|
11 |
|
---|
12 | @Repository
|
---|
13 | public interface WorkerRepository extends JpaRepository<Worker, Integer> {
|
---|
14 | Worker findByWorkerId(int id);
|
---|
15 |
|
---|
16 | void deleteByWorkerId(int id);
|
---|
17 |
|
---|
18 | Optional<Worker> findWorkerByEmail(String email);
|
---|
19 |
|
---|
20 | @Transactional
|
---|
21 | @Modifying
|
---|
22 | @Query("UPDATE Worker a " +
|
---|
23 | "SET a.enabled = TRUE WHERE a.email = ?1")
|
---|
24 | int enableWorker(String email);
|
---|
25 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.