@Singleton public class StudyResultDao extends AbstractDao
jpa
Modifier and Type | Method and Description |
---|---|
int |
count()
Returns the number of StudyResult rows
|
int |
countByBatch(Batch batch,
java.lang.String workerTypeToBeExcluded)
Returns the number of StudyResults belonging to the given batch but excludes results from the given
workerTypeToBeExcluded.
|
int |
countByBatchAndWorkerType(Batch batch,
java.lang.String workerType)
Returns the number of StudyResults belonging to the given batch and given worker type.
|
int |
countByGroup(GroupResult groupResult)
Returns the number of StudyResults belonging to the given group.
|
int |
countByStudy(Study study)
Returns the number of StudyResults belonging to the given study.
|
int |
countByWorker(Worker worker,
User user)
Returns the number of StudyResults belonging to the given worker.
|
java.util.Map<java.lang.Long,java.lang.Integer> |
countComponentResultsForStudyResultIds(java.util.List<java.lang.Long> srids) |
int |
countTotal()
Returns the total number of StudyResults (including the deleted ones)
|
void |
create(StudyResult studyResult) |
java.util.List<StudyResult> |
findAllByBatch(Batch batch) |
java.util.List<StudyResult> |
findAllByBatch(Batch batch,
java.lang.String workerTypeToBeExcluded,
int first,
int max)
Returns paginated StudyResults that belong to the given Batch but excludes results from the given
workerTypeToBeExcluded.
|
java.util.List<StudyResult> |
findAllByBatchAndWorkerType(Batch batch,
java.lang.String workerType,
int first,
int max)
Returns paginated StudyResults that belong to the given Batch and worker type.
|
java.util.List<StudyResult> |
findAllByGroup(GroupResult groupResult,
int first,
int max)
We can't use ScrollableResults for pagination since the MySQL Hibernate driver doesn't support it
(https://stackoverflow.com/a/2826512/1278769)
|
java.util.List<StudyResult> |
findAllByStudy(Study study) |
java.util.List<StudyResult> |
findAllByStudy(Study study,
int first,
int max)
Returns paginated StudyResults that belong to the given Study
We can't use ScrollableResults for pagination since the MySQL Hibernate driver doesn't support it
(https://stackoverflow.com/a/2826512/1278769)
|
java.util.List<StudyResult> |
findAllByWorker(Worker worker,
User user,
int first,
int max)
Returns paginated StudyResults that belong to the given Worker and User.
|
StudyResult |
findById(java.lang.Long id) |
java.util.List<StudyResult> |
findByIds(java.util.List<java.lang.Long> ids) |
java.util.List<StudyResult> |
findByIds(java.util.List<java.lang.Long> ids,
int first,
int max) |
java.util.Optional<StudyResult> |
findByStudyCode(java.lang.String studyCode) |
java.util.Optional<StudyResult> |
findByUuid(java.lang.String uuid) |
java.util.List<java.lang.Long> |
findIdsByBatchIds(java.util.List<java.lang.Long> batchIds) |
java.util.List<java.lang.Long> |
findIdsByComponentResultIds(java.util.List<java.lang.Long> crids)
Returns a list of unique study result IDs that belong to the given list of component result IDs.
|
java.util.List<java.lang.Long> |
findIdsByGroupIds(java.util.List<java.lang.Long> groupIds) |
java.util.List<java.lang.Long> |
findIdsByStudyId(java.lang.Long studyId) |
java.util.List<java.lang.Long> |
findIdsFromListThatBelongToStudy(java.util.List<java.lang.Long> srids,
java.lang.Long studyId) |
java.util.List<StudyResultStatus> |
findLastSeen(int limit)
Find the StudyResultStatus with the most recent lastSeen
|
java.util.Optional<StudyResultStatus> |
findLastStarted(Study study)
Find the StudyResultStatus with the most recent startDate that belongs to the given study
|
void |
refresh(StudyResult studyResult) |
void |
remove(StudyResult studyResult) |
void |
update(StudyResult studyResult) |
void |
updateStudySessionData(java.lang.Long id,
java.lang.String studySessionData)
Only update the 'studySessionData' field and leave everything else untouched
|
merge, persist, refresh, remove
public void create(StudyResult studyResult)
public void update(StudyResult studyResult)
public void updateStudySessionData(java.lang.Long id, java.lang.String studySessionData)
public void remove(StudyResult studyResult)
public void refresh(StudyResult studyResult)
public StudyResult findById(java.lang.Long id)
public java.util.List<StudyResult> findByIds(java.util.List<java.lang.Long> ids)
public java.util.List<StudyResult> findByIds(java.util.List<java.lang.Long> ids, int first, int max)
public java.util.Optional<StudyResult> findByUuid(java.lang.String uuid)
public java.util.Optional<StudyResult> findByStudyCode(java.lang.String studyCode)
public int count()
public int countTotal()
public int countByStudy(Study study)
public int countByBatch(Batch batch, java.lang.String workerTypeToBeExcluded)
public int countByWorker(Worker worker, User user)
public int countByGroup(GroupResult groupResult)
public int countByBatchAndWorkerType(Batch batch, java.lang.String workerType)
public java.util.List<StudyResult> findAllByStudy(Study study)
public java.util.List<java.lang.Long> findIdsByStudyId(java.lang.Long studyId)
public java.util.List<StudyResult> findAllByStudy(Study study, int first, int max)
public java.util.List<StudyResult> findAllByBatch(Batch batch)
public java.util.List<StudyResult> findAllByBatch(Batch batch, java.lang.String workerTypeToBeExcluded, int first, int max)
public java.util.List<StudyResult> findAllByBatchAndWorkerType(Batch batch, java.lang.String workerType, int first, int max)
public java.util.List<StudyResult> findAllByWorker(Worker worker, User user, int first, int max)
public java.util.List<StudyResult> findAllByGroup(GroupResult groupResult, int first, int max)
public java.util.Optional<StudyResultStatus> findLastStarted(Study study)
public java.util.List<StudyResultStatus> findLastSeen(int limit)
public java.util.List<java.lang.Long> findIdsByComponentResultIds(java.util.List<java.lang.Long> crids)
public java.util.List<java.lang.Long> findIdsFromListThatBelongToStudy(java.util.List<java.lang.Long> srids, java.lang.Long studyId)
public java.util.List<java.lang.Long> findIdsByBatchIds(java.util.List<java.lang.Long> batchIds)
public java.util.List<java.lang.Long> findIdsByGroupIds(java.util.List<java.lang.Long> groupIds)
public java.util.Map<java.lang.Long,java.lang.Integer> countComponentResultsForStudyResultIds(java.util.List<java.lang.Long> srids)