Last change
on this file since ce6ad22 was ce6ad22, checked in by DavidTrajkovski <davidtrajkovski11@…>, 3 years ago |
v1 initial prototype
|
-
Property mode
set to
100644
|
File size:
746 bytes
|
Line | |
---|
1 | package parkup.configs.token;
|
---|
2 |
|
---|
3 | import org.springframework.data.jpa.repository.JpaRepository;
|
---|
4 | import org.springframework.data.jpa.repository.Modifying;
|
---|
5 | import org.springframework.data.jpa.repository.Query;
|
---|
6 | import org.springframework.stereotype.Repository;
|
---|
7 |
|
---|
8 | import javax.transaction.Transactional;
|
---|
9 | import java.time.LocalDateTime;
|
---|
10 | import java.util.Optional;
|
---|
11 |
|
---|
12 | @Repository
|
---|
13 | public interface ConfirmationTokenRepository extends JpaRepository<ConfirmationToken,Integer> {
|
---|
14 |
|
---|
15 | Optional<ConfirmationToken> findByToken(String token);
|
---|
16 |
|
---|
17 | @Transactional
|
---|
18 | @Modifying
|
---|
19 | @Query("UPDATE ConfirmationToken c " +
|
---|
20 | "SET c.confirmedAt = ?2 " +
|
---|
21 | "WHERE c.token = ?1")
|
---|
22 | int updateConfirmedAt(String token, LocalDateTime confirmedAt);
|
---|
23 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.