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 TypeMethodDescriptionorg.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.findTopNByUserIdOrderByCreatedAtDesc(UUID userId, int limit) 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, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods 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 IDpageable- 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 IDpageable- 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 IDsessionId- the session IDpageable- pagination information- Returns:
- page of prompts for the user and session
-
findTopNByUserIdOrderByCreatedAtDesc
Find the most recent prompts for a user.- Parameters:
userId- the user IDlimit- the maximum number of results- Returns:
- list of recent prompts
-