Interface QuestionRepository
-
- All Superinterfaces:
CrudRepository<Question,UUID>,JpaRepository<Question,UUID>,PagingAndSortingRepository<Question,UUID>,QueryByExampleExecutor<Question>,Repository<Question,UUID>
public interface QuestionRepository extends JpaRepository<Question,UUID>
This interface defines various methods that can be used to query the database.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<List<Question>>findAllBySource(String source)Returns a list ofQuestionobjects identified by the source.Optional<Question>findByExternalKey(UUID externalKey)Returns aQuestionobject that matches the external key.Optional<Question>findByExternalKeyAndUser(UUID externalKey, User user)Returns aQuestionobject that matches the external key and user id.Optional<Question>findRandom()Returns a randomQuestionobject from the database.-
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, findOne
-
-
-
-
Method Detail
-
findByExternalKey
Optional<Question> findByExternalKey(UUID externalKey)
Returns aQuestionobject that matches the external key.- Parameters:
externalKey- External key in the form of universally unique identifier.- Returns:
- An optional Question object.
-
findByExternalKeyAndUser
Optional<Question> findByExternalKeyAndUser(UUID externalKey, User user)
Returns aQuestionobject that matches the external key and user id.- Parameters:
externalKey- External key in the form of universally unique identifier.user- User object- Returns:
- An optional Question object.
-
findAllBySource
Optional<List<Question>> findAllBySource(String source)
Returns a list ofQuestionobjects identified by the source.- Parameters:
source- A source in the form of a string.- Returns:
- An optional list of Question objects.
-
-