Class HibernateSequenceDAO

    • Method Detail

      • reset

        public void reset​(String sequence,
                          long objectId,
                          long tenantId,
                          long value)
        Description copied from interface: SequenceDAO
        Initializes the sequence value
        Specified by:
        reset in interface SequenceDAO
        Parameters:
        sequence - name of the sequence
        objectId - The sequence object ID
        tenantId - ID of the owning tenant
        value - The initial value
      • next

        public long next​(String sequence,
                         long objectId,
                         long tenantId,
                         long increment)
        Description copied from interface: SequenceDAO
        Returns the next value of the sequence by incrementing by the given increment
        Specified by:
        next in interface SequenceDAO
        Parameters:
        sequence - name of the sequence
        objectId - The sequence object ID
        tenantId - ID of the owning tenant
        increment - ID of the owning tenant
        Returns:
        The next value
      • next

        public long next​(String sequence,
                         long objectId,
                         long tenantId)
        Description copied from interface: SequenceDAO
        Returns the next value of the sequence
        Specified by:
        next in interface SequenceDAO
        Parameters:
        sequence - name of the sequence
        objectId - The sequence object ID
        tenantId - ID of the owning tenant
        Returns:
        The next value
      • getCurrentValue

        public long getCurrentValue​(String sequence,
                                    long objectId,
                                    long tenantId)
        Description copied from interface: SequenceDAO
        Gets the current value
        Specified by:
        getCurrentValue in interface SequenceDAO
        Parameters:
        sequence - name of the sequence
        objectId - value for the objectId field
        tenantId - identifier of the tenant
        Returns:
        current value of the sequence
      • findByName

        public List<Sequence> findByName​(String name,
                                         long tenantId)
        Description copied from interface: SequenceDAO
        Finds all sequences whose name starts with the passed name
        Specified by:
        findByName in interface SequenceDAO
        Parameters:
        name - name of the sequence
        tenantId - identifier of the tenant
        Returns:
        collection of sequences
      • findByAlternateKey

        public Sequence findByAlternateKey​(String name,
                                           long objectId,
                                           long tenantId)
        Description copied from interface: SequenceDAO
        Finds the sequence by the given alternate key
        Specified by:
        findByAlternateKey in interface SequenceDAO
        Parameters:
        name - name of the sequence
        objectId - value for the objectId field
        tenantId - identifier of the tenant
        Returns:
        the sequence object
      • delete

        public void delete​(String name,
                           long objectId,
                           long tenantId)
                    throws PersistenceException
        Description copied from interface: SequenceDAO
        Deletes the sequence
        Specified by:
        delete in interface SequenceDAO
        Parameters:
        name - name of the sequence
        objectId - value for the objectId field
        tenantId - identifier of the tenant
        Throws:
        PersistenceException - if a database error occurs