|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SqlQuery
The SQL Engine query contract definition. In fact it's an adapter or a proxy to an internal stuff in one of the stacks on top of which the SQL Processor works.
For the concrete implementation please see for example JdbcQuery.
For more info please see the Tutorials.
| Method Summary | |
|---|---|
SqlQuery |
addScalar(String columnAlias)
Declares a scalar query result, which is an SQL query execution output value. |
SqlQuery |
addScalar(String columnAlias,
Object type)
Declares a scalar query result, which is an SQL query execution output value. |
Object |
callFunction()
Executes the statements in the stored function, which return value of any type but the result set. |
List |
callList()
Returns the stored procedure execution results as a List. |
Object |
callUnique()
Convenience method to return a single instance that matches the stored procedure execution, or null if the stored procedure execution returns no results. |
int |
callUpdate()
Executes the update, delete, insert statement or other statements in the stored procedure, which don't return the result set. |
int[] |
executeBatch(String[] statements)
Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts. |
Object |
getQuery()
Returns the internal representation of this query. |
List |
list()
Returns the query results as a List. |
SqlQuery |
setFirstResult(int firstResult)
Sets the first row to retrieve. |
SqlQuery |
setMaxResults(int maxResults)
Sets the maximum number of rows to retrieve. |
SqlQuery |
setOrdered(boolean ordered)
Sets the indicator the SQL output is sorted. |
SqlQuery |
setParameter(String name,
Object val)
Binds a value to a named query parameter. |
SqlQuery |
setParameter(String name,
Object val,
Object type)
Binds a value to a named query parameter. |
SqlQuery |
setParameterList(String name,
Object[] vals)
Binds multiple values to a named query parameter. |
SqlQuery |
setParameterList(String name,
Object[] vals,
Object type)
Binds multiple values to a named query parameter. |
SqlQuery |
setTimeout(int timeout)
Sets a timeout for the underlying query. |
Object |
unique()
Convenience method to return a single instance that matches the query, or null if the query returns no results. |
int |
update()
Executes the update, delete or insert statement. |
| Method Detail |
|---|
Object getQuery()
SqlQuery setTimeout(int timeout)
timeout - the timeout in seconds
SqlQuery setFirstResult(int firstResult)
firstResult - a row number, numbered from 0
SqlQuery setMaxResults(int maxResults)
maxResults - the maximum number of rows
SqlQuery setOrdered(boolean ordered)
ordered - the indicator the SQL output is sorted
List list()
throws SqlProcessorException
SqlProcessorException - in the case of any problem in ORM or JDBC stack
Object unique()
throws SqlProcessorException
SqlProcessorException - in the case of any problem in ORM or JDBC stack
int update()
throws SqlProcessorException
SqlProcessorException - in the case of any problem in ORM or JDBC stack
List callList()
throws SqlProcessorException
SqlProcessorException - in the case of any problem in ORM or JDBC stack
Object callUnique()
throws SqlProcessorException
SqlProcessorException - in the case of any problem in ORM or JDBC stack
int callUpdate()
throws SqlProcessorException
SqlProcessorException - in the case of any problem in ORM or JDBC stack
Object callFunction()
throws SqlProcessorException
SqlProcessorException - in the case of any problem in ORM or JDBC stackSqlQuery addScalar(String columnAlias)
columnAlias - the name of the database column or the alias in the result set
SqlQuery addScalar(String columnAlias,
Object type)
columnAlias - the name of the database column or the alias in the result settype - the (META) type of the parameter
SqlQuery setParameter(String name,
Object val)
throws SqlProcessorException
name - the name of the parameterval - the not-null parameter value
SqlProcessorException - in the case of any problem in ORM or JDBC stack
SqlQuery setParameter(String name,
Object val,
Object type)
throws SqlProcessorException
name - the name of the parameterval - the possibly-null parameter valuetype - the (META) type of the parameter
SqlProcessorException - in the case of any problem in ORM or JDBC stack
SqlQuery setParameterList(String name,
Object[] vals)
throws SqlProcessorException
name - the name of the parametervals - a collection of values
SqlProcessorException - in the case of any problem in ORM or JDBC stack
SqlQuery setParameterList(String name,
Object[] vals,
Object type)
throws SqlProcessorException
name - the name of the parametervals - a collection of valuestype - the (META) type of the parameter
SqlProcessorException - in the case of any problem in ORM or JDBC stack
int[] executeBatch(String[] statements)
throws SqlProcessorException
statements - SQL statements to be executed in batch
SqlProcessorException - in the case of any problem in ORM or JDBC stack
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||