Interface LazyCollection<E>

  • Type Parameters:
    E - The element type
    All Superinterfaces:
    java.util.Collection<E>, java.lang.Iterable<E>, Lazy
    All Known Implementing Classes:
    ProxyCollection, Results, SingletonResults

    public interface LazyCollection<E>
    extends Lazy, java.util.Collection<E>
    Class which uses an ObjectStore to perform lazy fetching of data
    Author:
    Matthew Wakeling
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.List<E> asList()
      Return this Collection as a List.
      ResultsInfo getInfo()
      Returns Returns the current best estimate of the characteristics of the LazyCollection
      Query getQuery()
      Returns the Query used by this LazyCollection
      void setBatchSize​(int size)
      Sets the number of rows requested from the ObjectStore whenever an execute call is made
      void setNoExplain()
      Sets this LazyCollection to bypass the explain check in ObjectStore.execute().
      void setNoOptimise()
      Sets this LazyCollection to bypass the optimiser
      • Methods inherited from interface java.util.Collection

        add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Method Detail

      • setNoOptimise

        void setNoOptimise()
        Sets this LazyCollection to bypass the optimiser
      • setNoExplain

        void setNoExplain()
        Sets this LazyCollection to bypass the explain check in ObjectStore.execute().
      • getQuery

        Query getQuery()
        Returns the Query used by this LazyCollection
        Returns:
        a Query
      • asList

        java.util.List<E> asList()
        Return this Collection as a List. This may create a new ArrayList if necessary so the returned List is not guaranteed to be consistent if the LazyCollection changes.
        Returns:
        a List
      • getInfo

        ResultsInfo getInfo()
                     throws ObjectStoreException
        Returns Returns the current best estimate of the characteristics of the LazyCollection
        Returns:
        a ResultsInfo object
        Throws:
        ObjectStoreException - if an error occurs in the underlying ObjectStore
      • setBatchSize

        void setBatchSize​(int size)
        Sets the number of rows requested from the ObjectStore whenever an execute call is made
        Parameters:
        size - the number of rows