Interface UserRepository
-
- 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>
public interface UserRepository extends org.springframework.data.jpa.repository.JpaRepository<User,Long>
User repository is an interface class that extends JpaRepository and User entity This interface handles searching for users by different parameters including Google Oauth Key 2.0, events, photos, and display names.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<User>
findFirstByOauthKey(String oauthKey)
Optional<User>
findUserByDisplayName(String displayName)
Optional<User>
findUserByPhotosContaining(Photo photo)
Optional<User>
findUsersByEvents(Event event)
-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save
-
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlush
-
-
-
-
Method Detail
-
findFirstByOauthKey
Optional<User> findFirstByOauthKey(String oauthKey)
- Parameters:
oauthKey
- is a String input parameter from the user's google account.- Returns:
- Optionally returns a user found by their Oauth 2.0 key from Google.
-
findUsersByEvents
Optional<User> findUsersByEvents(Event event)
- Parameters:
event
- is an input parameter of a user's event.- Returns:
- Optionally returns a user by events.
-
findUserByPhotosContaining
Optional<User> findUserByPhotosContaining(Photo photo)
- Parameters:
photo
- is an input parameter of a user's photo.- Returns:
- Optionally returns a user by a photo containing the user.
-
-