Interface QuestionDAO

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Question,Integer>, org.springframework.data.repository.Repository<Question,Integer>

public interface QuestionDAO extends org.springframework.data.repository.CrudRepository<Question,Integer>
DAO for the Question.
Version:
0.4.1
Author:
Khalil
  • Method Details

    • findBySurveyId

      @Query("SELECT q FROM Question q INNER JOIN q.surveyQuestions s where s.survey.id = :id") Iterable<Question> findBySurveyId(@Param("id") int surveyId)
    • findByText

      @Query("SELECT q FROM Question q Where q.text LIKE %:text%") Iterable<Question> findByText(@Param("text") String text)
    • findByTextLazy

      @Query(nativeQuery=true, value="SELECT * FROM Question q where q.text LIKE %:text% ORDER BY q.id LIMIT :limit OFFSET :offset") Iterable<Question> findByTextLazy(@Param("text") String text, @Param("offset") int offset, @Param("limit") int limit)
    • findByUser

      @Query("SELECT q FROM Question q Where q.user.id = :id") Iterable<Question> findByUser(@Param("id") int userId)
    • findByUserLazy

      @Query(nativeQuery=true, value="SELECT * FROM Question q where q.user_id = :userId ORDER BY q.id LIMIT :limit OFFSET :offset") Iterable<Question> findByUserLazy(@Param("userId") int userId, @Param("offset") int offset, @Param("limit") int limit)
    • findByCategory

      @Query("SELECT q FROM Question q Where q.category.id = :id") Iterable<Question> findByCategory(@Param("id") int categoryId)
    • findByCategoryLazy

      @Query(nativeQuery=true, value="SELECT * FROM Question q where q.category_id = :categoryId ORDER BY q.id LIMIT :limit OFFSET :offset") Iterable<Question> findByCategoryLazy(@Param("categoryId") int categoryId, @Param("offset") int offset, @Param("limit") int limit)
    • findAllLazy

      @Query(nativeQuery=true, value="SELECT * FROM Question q ORDER BY q.id LIMIT :limit OFFSET :offset") Iterable<Question> findAllLazy(@Param("offset") int offset, @Param("limit") int limit)