public class PostgresStorageSession
extends org.hcjf.layers.storage.StorageSession
| Constructor and Description |
|---|
PostgresStorageSession(String implName,
Connection connection) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the postgres connection, when the connection is closed its is released to the
connections pool.
|
<R extends org.hcjf.layers.storage.actions.ResultSet> |
createResultSet(org.hcjf.layers.query.Query query,
ResultSet sqlResultSet,
Class resultType)
Creates a hcjf result set from a postgres data base result set.
|
Connection |
getConnection()
Return the instance of the pooled postgres connection asocciated to the session.
|
protected Object |
getValueFromColumn(Object columnValue)
Mapping some kind of data type from data base to java types.
|
void |
onError(Throwable throwable)
This method is callas when occurs an error in some operation over the session.
|
StringBuilder |
processEvaluators(StringBuilder result,
org.hcjf.layers.query.EvaluatorCollection collection)
Put into the query builder all the restrictions based on collection evaluator.
|
org.hcjf.layers.storage.actions.Select |
select(org.hcjf.layers.query.Query query)
Return the select (postgres implementation) instance associated to the query parameter.
|
PreparedStatement |
setValues(PreparedStatement statement,
org.hcjf.layers.query.EvaluatorCollection collection,
Integer index,
Object... params)
Set the values for the prepared statement.
|
org.hcjf.layers.storage.actions.Update |
update(org.hcjf.layers.query.Query query,
Map<String,Object> values)
Returns the update operation implementation.
|
delete, delete, delete, getImplName, getPostEvaluationStrategy, insert, insert, normalizeApplicationToDataSource, normalizeDataSourceToApplication, procedure, setPostEvaluationStrategy, update, update, update, update, update, upsert, upsertpublic PostgresStorageSession(String implName, Connection connection)
public final Connection getConnection()
public final void onError(Throwable throwable)
throwable - Throwable that represents the error.public void close()
throws IOException
IOExceptionpublic <R extends org.hcjf.layers.storage.actions.ResultSet> R createResultSet(org.hcjf.layers.query.Query query,
ResultSet sqlResultSet,
Class resultType)
throws SQLException,
IllegalAccessException,
InstantiationException
R - Expected kind of result set.query - Query instance that was evaluated for postgres engine.sqlResultSet - Postgres result set.resultType - Expected object to create hcjf result set.SQLExceptionIllegalAccessExceptionInstantiationExceptionprotected Object getValueFromColumn(Object columnValue) throws SQLException
columnValue - Value from data base column.SQLExceptionpublic StringBuilder processEvaluators(StringBuilder result, org.hcjf.layers.query.EvaluatorCollection collection)
result - Query builder.collection - Evaluator collection.public PreparedStatement setValues(PreparedStatement statement, org.hcjf.layers.query.EvaluatorCollection collection, Integer index, Object... params)
statement - Prepared statement.collection - Evaluator collection.index - Starting index of the parameters.params - Execution parameters.public org.hcjf.layers.storage.actions.Select select(org.hcjf.layers.query.Query query)
throws org.hcjf.layers.storage.StorageAccessException
select in class org.hcjf.layers.storage.StorageSessionquery - Query parameter.org.hcjf.layers.storage.StorageAccessExceptionpublic org.hcjf.layers.storage.actions.Update update(org.hcjf.layers.query.Query query,
Map<String,Object> values)
throws org.hcjf.layers.storage.StorageAccessException
update in class org.hcjf.layers.storage.StorageSessionquery - Query to filter the update.values - Values to be updated.org.hcjf.layers.storage.StorageAccessExceptionCopyright © 2017. All Rights Reserved.