Package com.example.seraphine.repository
Interface UserRepo
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<User,
,Long> org.springframework.data.jpa.repository.JpaRepository<User,
,Long> org.springframework.data.repository.PagingAndSortingRepository<User,
,Long> org.springframework.data.repository.query.QueryByExampleExecutor<User>
,org.springframework.data.repository.Repository<User,
Long>
@Transactional(readOnly=true)
@Repository
public interface UserRepo
extends org.springframework.data.jpa.repository.JpaRepository<User,Long>
Repository interface to access from data and model, also create entity for user
- Author:
- Loc Bui Nhien
-
Method Summary
Modifier and TypeMethodDescriptionint
enableAppUser
(String email) Enable this user to login.findByEmail
(String email) FindByEmail
(String email) Find this user by email.findByUsername
(String username) FindByUsername
(String username) Find this user by username.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, saveAll, saveAllAndFlush, saveAndFlush
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByEmail
-
findByUsername
-
enableAppUser
@Transactional @Modifying @Query("UPDATE User a SET a.enabled = TRUE WHERE a.email = ?1") int enableAppUser(String email) Enable this user to login.- Parameters:
email
-- Returns:
-
FindByEmail
Find this user by email.- Parameters:
email
-- Returns:
- user object found using email
-
FindByUsername
Find this user by username.- Parameters:
username
-- Returns:
- user object found using username
-