O - the type of result datapublic abstract class TopiaSQLQuery<O> extends Object
findSingleResult(TopiaContext)
or a multiple result with method findMultipleResult(TopiaContext).| Constructor and Description |
|---|
TopiaSQLQuery() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterExecuteQuery(ResultSet set)
A hook to obtain the result set just after the query execute.
|
protected void |
findMultipleResult(List<O> result,
ResultSet set)
Obtain a multi result given the result set and push in in the result list.
|
List<O> |
findMultipleResult(TopiaContext tx)
Obtain a multiple results fro the builded sql query.
|
List<O> |
findMultipleResult(TopiaContextImplementor tx)
Deprecated.
since 3.0, use now
findMultipleResult(TopiaContext). |
protected void |
findSingleResult(List<O> result,
ResultSet set)
Obtain a single result given the result set and push in in the result list.
|
O |
findSingleResult(TopiaContext tx)
Obtain a single result from the builded sql query.
|
O |
findSingleResult(TopiaContextImplementor tx)
Deprecated.
since 3.0, use now
findSingleResult(TopiaContext). |
protected String[] |
getColumnNames(ResultSet set)
Obtain the column names of a given result set using his metadata.
|
protected long |
getNbRows(ResultSet set)
From a given result set, let's count his number of row.
|
protected Map<String,Object> |
getRowAsMap(String[] columnNames,
ResultSet set)
Given the column names of the result set, transform the row of the
result set to a map with column name as key.
|
protected abstract PreparedStatement |
prepareQuery(Connection connection)
Prepare the statement used to do the sql query.
|
protected abstract O |
prepareResult(ResultSet set)
given a result set, extract the data.
|
protected abstract PreparedStatement prepareQuery(Connection connection) throws SQLException
connection - jdbc connection to useSQLException - if any problemprotected abstract O prepareResult(ResultSet set) throws SQLException
set - the result setnullSQLException - if any prob@Deprecated public O findSingleResult(TopiaContextImplementor tx) throws TopiaException
findSingleResult(TopiaContext).tx - the transaction used to execute the query.null if none found.TopiaException - for any pbpublic O findSingleResult(TopiaContext tx) throws TopiaException
tx - the transaction used to execute the query.null if none found.TopiaException - for any pb@Deprecated public List<O> findMultipleResult(TopiaContextImplementor tx) throws TopiaException
findMultipleResult(TopiaContext).tx - the transaction used to execute the query.TopiaException - for any pbpublic List<O> findMultipleResult(TopiaContext tx) throws TopiaException
tx - the transaction used to execute the query.TopiaException - for any pbprotected void afterExecuteQuery(ResultSet set) throws SQLException
set - the result set just obtainedSQLException - if any probprotected void findSingleResult(List<O> result, ResultSet set) throws SQLException
result - the result listset - the set of the executed sql querySQLException - if any pbprotected void findMultipleResult(List<O> result, ResultSet set) throws SQLException
result - the result listset - the set of the executed sql querySQLException - if any pbprotected String[] getColumnNames(ResultSet set) throws SQLException
set - the result set to inspectSQLException - if any pbprotected long getNbRows(ResultSet set) throws SQLException
set - the result set to inspectSQLException - if any pbprotected Map<String,Object> getRowAsMap(String[] columnNames, ResultSet set) throws SQLException
columnNames - column names of the result setset - the set to inspectSQLException - if any pbCopyright © 2004–2013 CodeLutin. All rights reserved.