Package daos.common

Class BatchDao


  • @Singleton
    public class BatchDao
    extends AbstractDao
    DAO of Batch entity
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void create​(Batch batch)  
      Batch findById​(java.lang.Long id)  
      java.util.Optional<Batch> findByUuid​(java.lang.String uuid)  
      void remove​(Batch batch)  
      void update​(Batch batch)  
      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).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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