public interface TopiaSqlSupport
| Modifier and Type | Method and Description |
|---|---|
void |
doSqlWork(TopiaSqlWork sqlWork)
Runs the given SQL work on the current context
|
void |
executeSql(String sqlScript)
Execute a given SQL code inside this transaction.
|
<O> List<O> |
findMultipleResult(SqlFunction<Connection,PreparedStatement> preparer,
SqlFunction<ResultSet,O> transformer)
Runs the given SQL query and return all his result if there is some.
|
<O> List<O> |
findMultipleResult(String sql,
SqlFunction<ResultSet,O> transformer)
Runs the given SQL query and return all his result if there is some.
|
<O> List<O> |
findMultipleResult(TopiaSqlQuery<O> query)
Runs the given SQL query and return all his result if there is some.
|
<O> O |
findSingleResult(SqlFunction<Connection,PreparedStatement> preparer,
SqlFunction<ResultSet,O> transformer)
Runs the given SQL query and return its first result if there is some.
|
<O> O |
findSingleResult(String sql,
SqlFunction<ResultSet,O> transformer)
Runs the given SQL query and return its first result if there is some.
|
<O> O |
findSingleResult(TopiaSqlQuery<O> query)
Runs the given SQL query and return its first result if there is some.
|
void |
setSlowQueriesThreshold(Duration threshold)
Tells to the context after which delay a query should be considered as slow.
|
void setSlowQueriesThreshold(Duration threshold)
threshold - the new value to setvoid executeSql(String sqlScript)
sqlScript - the sql script to executevoid doSqlWork(TopiaSqlWork sqlWork)
sqlWork - the SQL work instance to execute<O> O findSingleResult(TopiaSqlQuery<O> query) throws TopiaException
O - type of resultquery - query to playnull if none found.TopiaException - for any pb<O> O findSingleResult(SqlFunction<Connection,PreparedStatement> preparer, SqlFunction<ResultSet,O> transformer) throws TopiaException
O - type of resultpreparer - function to prepare the querytransformer - function to transform the ResultSet into the expected elementnull if none found.TopiaException - for any pb<O> O findSingleResult(String sql, SqlFunction<ResultSet,O> transformer) throws TopiaException
O - type of resultsql - the sql querytransformer - function to transform the ResultSet into the expected elementnull if none found.TopiaException - for any pb<O> List<O> findMultipleResult(TopiaSqlQuery<O> query) throws TopiaException
O - type of resultquery - query to playTopiaException - for any pb<O> List<O> findMultipleResult(SqlFunction<Connection,PreparedStatement> preparer, SqlFunction<ResultSet,O> transformer) throws TopiaException
O - type of resultpreparer - function to prepare the querytransformer - function to transform the ResultSet into the expected elementTopiaException - for any pb<O> List<O> findMultipleResult(String sql, SqlFunction<ResultSet,O> transformer) throws TopiaException
O - type of resultsql - the sql querytransformer - function to transform the ResultSet into the expected elementTopiaException - for any pbCopyright © 2004–2020 Code Lutin. All rights reserved.