Interface SurveyDAO

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

public interface SurveyDAO extends org.springframework.data.repository.CrudRepository<Survey,Integer>
DAO for the Survey class.
Version:
0.4.1
Author:
Luca Milazzo
  • Method Details

    • findByText

      @Query(nativeQuery=true, value="SELECT * FROM Survey s Where s.name LIKE %:text% OR CAST( s.id AS char(90)) = :id") Iterable<Survey> findByText(@Param("text") String text, @Param("id") String id)
    • findByTextLazy

      @Query(nativeQuery=true, value="SELECT * FROM Survey s where s.name LIKE %:text% OR CAST( s.id AS char(90))= :id ORDER BY s.id LIMIT :limit OFFSET :offset") Iterable<Survey> findByTextLazy(@Param("text") String text, @Param("id") String id, @Param("offset") int offset, @Param("limit") int limit)
    • findAllLazy

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

      @Query(nativeQuery=true, value="SELECT s.* FROM Answer as a JOIN Survey as s on a.survey_id = s.id WHERE a.user_id = :id") Optional<Survey> findByCompilationCode(@Param("id") int id)