Package daos.common
Class BatchDao
- java.lang.Object
-
- daos.common.AbstractDao
-
- daos.common.BatchDao
-
@Singleton public class BatchDao extends AbstractDao
DAO of Batch entity
-
-
Field Summary
-
Fields inherited from class daos.common.AbstractDao
jpa
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreate(Batch batch)BatchfindById(java.lang.Long id)java.util.Optional<Batch>findByUuid(java.lang.String uuid)voidremove(Batch batch)voidupdate(Batch batch)java.lang.LongupdateBatchSession(java.lang.Long batchId, java.lang.Long expectedVersion, java.lang.String sessionData)Atomically updates batchSessionData and increments batchSessionVersion, but only if the current version matches the expectedVersion (compare-and-set).
-
-
-
Method Detail
-
create
public void create(Batch batch)
-
update
public void update(Batch batch)
-
remove
public void remove(Batch batch)
-
findById
public Batch findById(java.lang.Long id)
-
findByUuid
public java.util.Optional<Batch> findByUuid(java.lang.String uuid)
-
updateBatchSession
public java.lang.Long updateBatchSession(java.lang.Long batchId, java.lang.Long expectedVersion, java.lang.String sessionData)Atomically updates batchSessionData and increments batchSessionVersion, but only if the current version matches the expectedVersion (compare-and-set).- Returns:
- The new batchSessionVersion if the update succeeded (exactly one row updated), null if the version mismatched
-
-