@Singleton
public class BatchService
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
Batch |
bindToBatch(BatchProperties props) |
BatchSession |
bindToBatchSession(Batch batch) |
BatchProperties |
bindToProperties(Batch batch) |
Batch |
clone(Batch batch)
Clones a Batch but does not persists.
|
void |
createAndPersistBatch(Batch batch,
Study study,
User signedinUser)
Creates batch, initialises it and persists it.
|
Batch |
createDefaultBatch(Study study)
Create and initialises default Batch.
|
Batch |
fetchBatch(java.lang.Long batchId,
Study study)
Gets the batch with given ID from the database or if the batchId is -1
returns the default batch of this study.
|
void |
remove(Batch batch,
User signedinUser)
Removes batch, all it's StudyResults, ComponentResults, GroupResults and
Workers (if they don't belong to another batch) and persists the changes
to the database.
|
void |
updateBatch(Batch batch,
BatchProperties updatedBatchProps)
Updates the given batch in the database with the given BatchProperties
|
boolean |
updateBatchSession(long batchId,
BatchSession batchSession) |
public Batch clone(Batch batch)
public Batch createDefaultBatch(Study study)
public void createAndPersistBatch(Batch batch, Study study, User signedinUser)
public void updateBatch(Batch batch, BatchProperties updatedBatchProps)
public BatchProperties bindToProperties(Batch batch)
public Batch bindToBatch(BatchProperties props)
public BatchSession bindToBatchSession(Batch batch)
public boolean updateBatchSession(long batchId, BatchSession batchSession)
public Batch fetchBatch(java.lang.Long batchId, Study study) throws NotFoundException
NotFoundException