Last change
on this file since dfd5d87 was dfd5d87, checked in by Marko <Marko@…>, 23 months ago |
Registration logic with confirmation token implemented
|
-
Property mode
set to
100644
|
File size:
728 bytes
|
Rev | Line | |
---|
[dfd5d87] | 1 | package finki.it.phoneluxbackend.repositories;
|
---|
| 2 |
|
---|
| 3 | import finki.it.phoneluxbackend.entities.User;
|
---|
| 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 |
|
---|
| 11 | import java.util.Optional;
|
---|
| 12 |
|
---|
| 13 | @Repository
|
---|
| 14 | @Transactional(readOnly = true)
|
---|
| 15 | public interface UserRepository extends JpaRepository<User,Long> {
|
---|
| 16 | Optional<User> findByEmail(String email);
|
---|
| 17 |
|
---|
| 18 | @Transactional
|
---|
| 19 | @Modifying
|
---|
| 20 | @Query("UPDATE users a " +
|
---|
| 21 | "SET a.enabled = TRUE WHERE a.email = ?1")
|
---|
| 22 | int enableUser(String email);
|
---|
| 23 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.