Class Select<S extends StorageSession,​O>

    • Constructor Summary

      Constructors 
      Constructor Description
      Select​(S session, java.lang.Class modelClass, Queryable queryable)  
      Select​(S session, Queryable queryable)  
    • Method Summary

      Modifier and Type Method Description
      protected abstract Queryable adaptQuery​(Queryable queryable)
      This method must adapt the original query and create a new query supported by the underlying technology.
      protected abstract <R> java.util.Collection<R> createResultSet​(O executionResult)
      Creates the expected data type using the raw data obtained from the underlying technology.
      <R> ResultSet<R> execute()
      The select implementation has 4 steps to obtain the result set
      protected abstract O executeQuery​(Queryable queryable)
      This method execute the adapted query instance on the underlying technology and returns the result set instance provided for that technology.
      protected Queryable getQueryable()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Select

        public Select​(S session,
                      java.lang.Class modelClass,
                      Queryable queryable)
      • Select

        public Select​(S session,
                      Queryable queryable)
    • Method Detail

      • getQueryable

        protected final Queryable getQueryable()
      • execute

        public <R> ResultSet<R> execute()
        The select implementation has 4 steps to obtain the result set. - First, adapt the query in order to create a new query executable for the underlying technology. - Second, call the underlying technology in order to obtain the raw information. - Third, create a collection of data in the presentation format using the row data. - Fourth, Validate the integrity of the result set using the original query. As result of these four step, the method returns a instance of result set.
        Specified by:
        execute in class StorageAction<S extends StorageSession>
        Type Parameters:
        R - Expected result set data.
        Returns:
        Result set instance.
      • adaptQuery

        protected abstract Queryable adaptQuery​(Queryable queryable)
        This method must adapt the original query and create a new query supported by the underlying technology.
        Parameters:
        queryable - Original query.
        Returns:
        Adapted query.
      • executeQuery

        protected abstract O executeQuery​(Queryable queryable)
        This method execute the adapted query instance on the underlying technology and returns the result set instance provided for that technology.
        Parameters:
        queryable - Adapted query obtained into the previous step.
        Returns:
        Result set.
      • createResultSet

        protected abstract <R> java.util.Collection<R> createResultSet​(O executionResult)
        Creates the expected data type using the raw data obtained from the underlying technology.
        Type Parameters:
        R - Expected data type.
        Parameters:
        executionResult - Object that represent the result set obtained in the previous step.
        Returns:
        Collection with all the instances created from the raw data.