Package org.hcjf.layers.storage.actions
Class Select<S extends StorageSession,O>
- java.lang.Object
-
- org.hcjf.layers.storage.actions.StorageAction<S>
-
- org.hcjf.layers.storage.actions.Select<S,O>
-
public abstract class Select<S extends StorageSession,O> extends StorageAction<S>
Select storage operation.- Author:
- javaito
-
-
Method Summary
Modifier and Type Method Description protected abstract QueryableadaptQuery(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 setprotected abstract OexecuteQuery(Queryable queryable)This method execute the adapted query instance on the underlying technology and returns the result set instance provided for that technology.protected QueryablegetQueryable()-
Methods inherited from class org.hcjf.layers.storage.actions.StorageAction
getModelClass, getSession
-
-
-
-
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:
executein classStorageAction<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.
-
-