Last change
on this file was f25d07e, checked in by Marko <Marko@…>, 2 years ago |
Edited registration and login services
|
-
Property mode
set to
100644
|
File size:
844 bytes
|
Line | |
---|
1 | package finki.it.phoneluxbackend.repositories;
|
---|
2 |
|
---|
3 | import finki.it.phoneluxbackend.entities.ConfirmationToken;
|
---|
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 org.springframework.transaction.annotation.Transactional;
|
---|
9 |
|
---|
10 | import java.time.LocalDateTime;
|
---|
11 | import java.util.Optional;
|
---|
12 |
|
---|
13 | @Repository
|
---|
14 | public interface ConfirmationTokenRepository extends JpaRepository<ConfirmationToken,Long> {
|
---|
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.