Interface UserRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<UserEntity,
,Long> org.springframework.data.jpa.repository.JpaRepository<UserEntity,
,Long> org.springframework.data.jpa.repository.JpaSpecificationExecutor<UserEntity>
,org.springframework.data.repository.ListCrudRepository<UserEntity,
,Long> org.springframework.data.repository.ListPagingAndSortingRepository<UserEntity,
,Long> org.springframework.data.repository.PagingAndSortingRepository<UserEntity,
,Long> org.springframework.data.repository.query.QueryByExampleExecutor<UserEntity>
,org.springframework.data.repository.Repository<UserEntity,
Long>
public interface UserRepository
extends org.springframework.data.jpa.repository.JpaRepository<UserEntity,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<UserEntity>
Repository interface for managing
UserEntity
entities.
Provides standard CRUD operations via JpaRepository
and supports
complex queries via JpaSpecificationExecutor
.-
Method Summary
Modifier and TypeMethodDescriptionfindByEmail
(String email) Finds a user by their email address.findByUsername
(String username) Finds a user by their 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, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush
Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, delete, exists, findAll, findAll, findAll, findBy, findOne
Methods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAll
Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAll
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
-
findByUsername
Finds a user by their username.- Parameters:
username
- the username to search for- Returns:
- an
Optional
containing the foundUserEntity
, or empty if no user found
-
findByEmail
Finds a user by their email address.- Parameters:
email
- the email address to search for- Returns:
- an
Optional
containing the foundUserEntity
, or empty if no user found
-