Last change
on this file since 7e88e46 was f25d07e, checked in by Marko <Marko@…>, 2 years ago |
Edited registration and login services
|
-
Property mode
set to
100644
|
File size:
727 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
|
---|
[f25d07e] | 20 | @Query("UPDATE User a " +
|
---|
[dfd5d87] | 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.