Interface PromptRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<PromptEntity, UUID>, org.springframework.data.jpa.repository.JpaRepository<PromptEntity, UUID>, org.springframework.data.repository.ListCrudRepository<PromptEntity, UUID>, org.springframework.data.repository.ListPagingAndSortingRepository<PromptEntity, UUID>, org.springframework.data.repository.PagingAndSortingRepository<PromptEntity, UUID>, org.springframework.data.repository.query.QueryByExampleExecutor<PromptEntity>, org.springframework.data.repository.Repository<PromptEntity, UUID>

public interface PromptRepository extends org.springframework.data.jpa.repository.JpaRepository<PromptEntity, UUID>
Repository for prompt entities.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.data.domain.Page<PromptEntity>
    findBySessionId(String sessionId, org.springframework.data.domain.Pageable pageable)
    Find prompts by session ID.
    org.springframework.data.domain.Page<PromptEntity>
    findByUserId(UUID userId, org.springframework.data.domain.Pageable pageable)
    Find prompts by user ID.
    org.springframework.data.domain.Page<PromptEntity>
    findByUserIdAndSessionId(UUID userId, String sessionId, org.springframework.data.domain.Pageable pageable)
    Find prompts by user ID and session ID.
    Find the most recent prompts for a user.

    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.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

    • findByUserId

      org.springframework.data.domain.Page<PromptEntity> findByUserId(UUID userId, org.springframework.data.domain.Pageable pageable)
      Find prompts by user ID.
      Parameters:
      userId - the user ID
      pageable - pagination information
      Returns:
      page of prompts for the user
    • findBySessionId

      org.springframework.data.domain.Page<PromptEntity> findBySessionId(String sessionId, org.springframework.data.domain.Pageable pageable)
      Find prompts by session ID.
      Parameters:
      sessionId - the session ID
      pageable - pagination information
      Returns:
      page of prompts for the session
    • findByUserIdAndSessionId

      org.springframework.data.domain.Page<PromptEntity> findByUserIdAndSessionId(UUID userId, String sessionId, org.springframework.data.domain.Pageable pageable)
      Find prompts by user ID and session ID.
      Parameters:
      userId - the user ID
      sessionId - the session ID
      pageable - pagination information
      Returns:
      page of prompts for the user and session
    • findTopNByUserIdOrderByCreatedAtDesc

      List<PromptEntity> findTopNByUserIdOrderByCreatedAtDesc(UUID userId, int limit)
      Find the most recent prompts for a user.
      Parameters:
      userId - the user ID
      limit - the maximum number of results
      Returns:
      list of recent prompts