@Singleton public class ComponentResultDao extends AbstractDao
jpa
Modifier and Type | Method and Description |
---|---|
void |
appendData(java.lang.Long id,
java.lang.String data)
Append data to 'data' field and replace data in 'dataShort' and 'dataSize'
|
int |
count() |
int |
countByComponent(Component component)
Returns the number of ComponentResults belonging to the given Component.
|
void |
create(ComponentResult componentResult) |
java.util.List<ComponentResult> |
findAllByComponent(Component component) |
java.util.List<ComponentResult> |
findAllByComponent(Component component,
int first,
int max)
Returns paginated ComponentResult that belong to the given Component
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<java.lang.Long> |
findAllIdsWhereDataSizeIsNull()
Fetches all ComponentResults without 'dataSize' (is null).
|
ComponentResult |
findById(java.lang.Long id) |
java.util.List<ComponentResult> |
findByIds(java.util.List<java.lang.Long> ids) |
java.util.List<java.lang.Long> |
findIdsByComponentIds(java.util.List<java.lang.Long> componentIds) |
java.util.List<java.lang.Long> |
findIdsByComponentResultIds(java.util.List<java.lang.Long> crids)
Takes a list component result IDs and checks if they exist in the database.
|
java.util.List<java.lang.Long> |
findIdsByComponentUuids(java.util.List<java.lang.String> componentUuids) |
java.util.List<java.lang.Long> |
findIdsByStudyIds(java.util.List<java.lang.Long> studyIds) |
java.util.List<java.lang.Long> |
findIdsByStudyResultId(java.lang.Long srid) |
java.util.List<java.lang.Long> |
findIdsByStudyUuids(java.util.List<java.lang.String> studyUuids) |
java.util.List<java.lang.Long> |
findOrderedIdsByOrderedStudyResultIds(java.util.List<java.lang.Long> orderedSrids)
Returns a list of component result IDs that belong to the given list of study result IDs.
|
java.lang.String |
getData(java.lang.Long id)
Get 'data' field without fetching the whole row.
|
void |
purgeData(java.lang.Long id) |
void |
refresh(ComponentResult componentResult) |
void |
remove(ComponentResult componentResult) |
void |
replaceData(java.lang.Long id,
java.lang.String data)
Overwrite data in 'data' fields (data, dataShort, dataSize)
|
void |
setDataSizeAndDataShort(java.lang.Long id)
Only set the 'dataShort' and 'dataSize' field with data from 'data' (used only during update from an old version
of JATOS that didn't have those fields yet).
|
long |
sizeByStudy(Study study)
Returns data size (in Byte) that is occupied by the 'data' field of all component results belonging to the given
study.
|
void |
update(ComponentResult componentResult) |
merge, persist, refresh, remove
public void create(ComponentResult componentResult)
public void update(ComponentResult componentResult)
public void replaceData(java.lang.Long id, java.lang.String data)
public void purgeData(java.lang.Long id)
public void appendData(java.lang.Long id, java.lang.String data)
public void setDataSizeAndDataShort(java.lang.Long id)
public java.lang.String getData(java.lang.Long id)
public void remove(ComponentResult componentResult)
public void refresh(ComponentResult componentResult)
public ComponentResult findById(java.lang.Long id)
public java.util.List<ComponentResult> findByIds(java.util.List<java.lang.Long> ids)
public int count()
public int countByComponent(Component component)
public java.util.List<java.lang.Long> findAllIdsWhereDataSizeIsNull()
public java.util.List<ComponentResult> findAllByComponent(Component component)
public java.util.List<ComponentResult> findAllByComponent(Component component, int first, int max)
public long sizeByStudy(Study study)
public java.util.List<java.lang.Long> findIdsByComponentIds(java.util.List<java.lang.Long> componentIds)
public java.util.List<java.lang.Long> findIdsByComponentUuids(java.util.List<java.lang.String> componentUuids)
public java.util.List<java.lang.Long> findIdsByStudyIds(java.util.List<java.lang.Long> studyIds)
public java.util.List<java.lang.Long> findIdsByStudyUuids(java.util.List<java.lang.String> studyUuids)
public java.util.List<java.lang.Long> findIdsByStudyResultId(java.lang.Long srid)
public java.util.List<java.lang.Long> findOrderedIdsByOrderedStudyResultIds(java.util.List<java.lang.Long> orderedSrids)
public java.util.List<java.lang.Long> findIdsByComponentResultIds(java.util.List<java.lang.Long> crids)