Package org.sqlproc.engine.impl
Class SqlStandardControl
java.lang.Object
org.sqlproc.engine.impl.SqlStandardControl
- All Implemented Interfaces:
SqlControl
The compound parameters controlling the META SQL execution.
For more info please see the Tutorials.
- Author:
- Vladimir Hudec
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.sqlproc.engine.SqlControl
SqlControl.LowLevelSqlCallback, SqlControl.SqlExecutionCallback
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Object
The object used for the SQL update statement dynamic input values.The optional features.private Integer
Returns the fetch size of SQL execution output rows, which can be returned in one SQL statement.private Integer
The first SQL execution output row to be returned in the case we need to skip some rows in the result set.private SqlControl.LowLevelSqlCallback
The low level SQL callback handler.private Integer
The max number of SQL execution output rows, which can be returned in the result list.private Integer
The max SQL execution time.More result classes used for the return values, like the collections classes or the collections items.private SqlOrder
The ordering directive list.private String
The unique ID of the executed statement based on input values combination.private Boolean
The indicator, that an empty INSERT or UPDATE statement execution should be ignored (for example update statement without any bounded input values).private SqlControl.SqlExecutionCallback
The SQL command execution callback handler.private String
The name of the required SQL Query Engine instance.private Object
The object used for the SQL statement dynamic input values. -
Constructor Summary
ConstructorsConstructorDescriptionStandard constructor.SqlStandardControl
(SqlControl sqlControl) Merging constructor. -
Method Summary
Modifier and TypeMethodDescriptionThe object used for the SQL update statement dynamic input values.Returns the optional features.Returns the fetch size of SQL execution output rows, which can be returned in one SQL statement.Returns the first SQL execution output row to be returned in the case we need to skip some rows in the result set.Returns the low level SQL callback handlerReturns the max number of SQL execution output rows, which can be returned in the result list.Returns the max SQL execution time.Returns more result classes used for the return values, like the collections classes or the collections items.getOrder()
Returns the ordering directive list.Returns the unique ID of the executed statement based on the input values combination.Returns the indicator, that an empty INSERT or UPDATE statement execution should be ignored (for example update statement without any bounded input values).Returns the SQL command execution callback handlerReturns the name of the required SQL Query Engine instanceReturns the object used for the SQL statement static input values.setAscOrder
(int order) Sets the ordering directive list.setAscOrder
(String order) Sets the ordering directive list.setAscOrderNullsLast
(int order) Sets the ordering directive list.setAscOrderNullsLast
(String order) Sets the ordering directive list.setDescOrder
(int order) Sets the ordering directive list.setDescOrder
(String order) Sets the ordering directive list.setDescOrderNullsFirst
(int order) Sets the ordering directive list.setDescOrderNullsFirst
(String order) Sets the ordering directive list.setDynamicUpdateValues
(Object dynamicUpdateValues) Sets the object used for the SQL update statement dynamic input values.setFeature
(String name, Object value) Sets the optional feature in the stament's execution scope.setFeatures
(Map<String, Object> features) Sets the optional features.setFetchSize
(Integer fetchSize) Sets the fetch size of SQL execution output rows, which can be returned in one SQL statement.setFirstResult
(Integer firstResult) Sets the first SQL execution output row to be returned in the case we need to skip some rows in the result set.setLowLevelSqlCallback
(SqlControl.LowLevelSqlCallback lowLevelSqlCallback) Sets the low level SQL callback handler.setMaxResults
(Integer maxResults) Sets the max number of SQL execution output rows, which can be returned in the result list.setMaxTimeout
(Integer maxTimeout) Sets the max SQL execution time.setMoreResultClasses
(Map<String, Class<?>> moreResultClasses) Sets more result classes used for the return values, like the collections classes or the collections items.Sets the ordering directive list.setProcessingId
(String processingId) Sets the unique ID of the executed statement based on input values combination.void
setSkipEmptyStatement
(Boolean skipEmptyStatement) Sets the indicator, that an empty INSERT or UPDATE statement execution should be ignored (for example update statement without any bounded input values).setSqlExecutionCallback
(SqlControl.SqlExecutionCallback sqlExecutionCallback) Sets the SQL command execution callback handler.setSqlName
(String sqlName) Sets the name of the required SQL Query Engine instancesetStaticInputValues
(Object staticInputValues) Sets the object used for the SQL statement static input values.toString()
unsetFeatures
(Set<String> names) Clears the optional features in the stament's or execution scope.
-
Field Details
-
staticInputValues
The object used for the SQL statement dynamic input values. The class of this object is also named as the input class or the dynamic parameters class. The exact class type isn't important, all the parameters settled into the SQL prepared statement are picked up using the reflection API. -
dynamicUpdateValues
The object used for the SQL update statement dynamic input values. This enables to split input values into value used for WHERE fragment and for UPDATE fragment of the SQL statement. In the case this parameter is null, the dynamicInputValues parameter forSqlCrudEngine.update(SqlSession, Object, SqlControl)
holds all input values. -
maxTimeout
The max SQL execution time. This parameter can help to protect production system against ineffective SQL query commands. The value is in milliseconds. -
firstResult
The first SQL execution output row to be returned in the case we need to skip some rows in the result set. The primary usage is to support the pagination. -
maxResults
The max number of SQL execution output rows, which can be returned in the result list. The primary usage is to support the pagination. -
order
The ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement. -
moreResultClasses
More result classes used for the return values, like the collections classes or the collections items. They are used mainly for the one-to-one, one-to-many and many-to-many associations. -
features
The optional features. These features are defined in the statement execution scope. In the case of conflict with the optional features defined in sthe statement/global scope, their priority is higher. -
processingId
The unique ID of the executed statement based on input values combination. This ID can be used for the caching purposes to optimize theSqlMetaStatement.process(org.sqlproc.engine.impl.SqlMetaStatement.Type, Object, SqlControl, org.sqlproc.engine.SqlEngine)
The generation of the final ANSI SQL statement from the META SQL statement is influenced by the input values combination. This ID is an indicator of the uniqueness these input values. For more info please see the tutorials. -
fetchSize
Returns the fetch size of SQL execution output rows, which can be returned in one SQL statement. -
skipEmptyStatement
The indicator, that an empty INSERT or UPDATE statement execution should be ignored (for example update statement without any bounded input values). -
lowLevelSqlCallback
The low level SQL callback handler. Enables the input values and the final SQL command modification before the required database command execution. Enables the output values modification after the required database command execution. -
sqlExecutionCallback
The SQL command execution callback handler. Enables the input values and the final SQL command modification before the required database command execution. Enables the output values modification after the required database command execution. -
sqlName
The name of the required SQL Query Engine instance. It can be used in the case the name is to be chosen in the runtime.
-
-
Constructor Details
-
SqlStandardControl
public SqlStandardControl()Standard constructor. -
SqlStandardControl
Merging constructor.
-
-
Method Details
-
getStaticInputValues
Returns the object used for the SQL statement static input values. The class of this object is also named as the input class or the static parameters class. The exact class type isn't important, all the parameters injected into the SQL query command are picked up using the reflection API. Compared to dynamicInputValues input parameters, parameters in this class should't be produced by an end user to prevent SQL injection threat!- Specified by:
getStaticInputValues
in interfaceSqlControl
- Returns:
- the object used for the SQL statement static input values
-
setStaticInputValues
Sets the object used for the SQL statement static input values. The class of this object is also named as the input class or the static parameters class. The exact class type isn't important, all the parameters injected into the SQL query command are picked up using the reflection API. Compared to dynamicInputValues input parameters, parameters in this class should't be produced by an end user to prevent SQL injection threat!- Parameters:
staticInputValues
- the object used for the SQL statement static input values- Returns:
- this instance
-
getDynamicUpdateValues
The object used for the SQL update statement dynamic input values. This enables to split input values into value used for WHERE fragment and for UPDATE fragment of the SQL statement. In the case this parameter is null, the dynamicInputValues parameter forSqlCrudEngine.update(SqlSession, Object, SqlControl)
holds all input values.- Specified by:
getDynamicUpdateValues
in interfaceSqlControl
- Returns:
- the object used for the SQL update statement dynamic input values (UPDATE fragment)
-
setDynamicUpdateValues
Sets the object used for the SQL update statement dynamic input values. This enables to split input values into value used for WHERE fragment and for UPDATE fragment of the SQL statement. In the case this parameter is null, the dynamicInputValues parameter forSqlCrudEngine.update(SqlSession, Object, SqlControl)
holds all input values.- Parameters:
dynamicUpdateValues
- the object used for the SQL update statement dynamic input values (UPDATE fragment)- Returns:
- this instance
-
getMaxTimeout
Returns the max SQL execution time. This parameter can help to protect production system against ineffective SQL query commands. The value is in milliseconds.- Specified by:
getMaxTimeout
in interfaceSqlControl
- Returns:
- the max SQL execution time
-
setMaxTimeout
Sets the max SQL execution time. This parameter can help to protect production system against ineffective SQL query commands. The value is in milliseconds.- Parameters:
maxTimeout
- the max SQL execution time- Returns:
- this instance
-
getFirstResult
Returns the first SQL execution output row to be returned in the case we need to skip some rows in the result set. The primary usage is to support the pagination.- Specified by:
getFirstResult
in interfaceSqlControl
- Returns:
- the first SQL execution output row
-
setFirstResult
Sets the first SQL execution output row to be returned in the case we need to skip some rows in the result set. The primary usage is to support the pagination.- Parameters:
firstResult
- the first SQL execution output row- Returns:
- this instance
-
getMaxResults
Returns the max number of SQL execution output rows, which can be returned in the result list. The primary usage is to support the pagination.- Specified by:
getMaxResults
in interfaceSqlControl
- Returns:
- the max number of SQL execution output rows
-
setMaxResults
Sets the max number of SQL execution output rows, which can be returned in the result list. The primary usage is to support the pagination.- Parameters:
maxResults
- the max number of SQL execution output rows- Returns:
- this instance
-
getOrder
Returns the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.- Specified by:
getOrder
in interfaceSqlControl
- Returns:
- the ordering directive list
-
setOrder
Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.- Parameters:
order
- the ordering directive list- Returns:
- this instance
-
setAscOrder
Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.- Parameters:
order
- the ordering directive- Returns:
- this instance
-
setAscOrderNullsLast
Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.- Parameters:
order
- the ordering directive- Returns:
- this instance
-
setAscOrder
Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.- Parameters:
order
- the ordering directive- Returns:
- this instance
-
setAscOrderNullsLast
Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.- Parameters:
order
- the ordering directive- Returns:
- this instance
-
setDescOrder
Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.- Parameters:
order
- the ordering directive- Returns:
- this instance
-
setDescOrderNullsFirst
Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.- Parameters:
order
- the ordering directive- Returns:
- this instance
-
setDescOrder
Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.- Parameters:
order
- the ordering directive- Returns:
- this instance
-
setDescOrderNullsFirst
Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.- Parameters:
order
- the ordering directive- Returns:
- this instance
-
getMoreResultClasses
Returns more result classes used for the return values, like the collections classes or the collections items. They are used mainly for the one-to-one, one-to-many and many-to-many associations.- Specified by:
getMoreResultClasses
in interfaceSqlControl
- Returns:
- more result classes used for the return values
-
setMoreResultClasses
Sets more result classes used for the return values, like the collections classes or the collections items. They are used mainly for the one-to-one, one-to-many and many-to-many associations.- Parameters:
moreResultClasses
- more result classes used for the return values- Returns:
- this instance
-
getFeatures
Returns the optional features. These features are defined in the statement execution scope. In the case of conflict with the optional features defined in sthe statement/global scope, their priority is higher.- Specified by:
getFeatures
in interfaceSqlControl
- Returns:
- the optional features
-
setFeatures
Sets the optional features. These features are defined in the statement execution scope. In the case of conflict with the optional features defined in sthe statement/global scope, their priority is higher.- Parameters:
features
- the optional features
-
setFeature
Sets the optional feature in the stament's execution scope.- Parameters:
name
- the name of the optional featurevalue
- the value of the optional feature
-
unsetFeatures
Clears the optional features in the stament's or execution scope.- Parameters:
names
- the names of the optional features
-
getProcessingId
Returns the unique ID of the executed statement based on the input values combination. This ID can be used for the caching purposes to optimize theSqlMetaStatement.process(org.sqlproc.engine.impl.SqlMetaStatement.Type, Object, SqlControl, SqlEngine)
The generation of the final ANSI SQL statement from the META SQL statement is influenced by the input values. This ID is an indicator of the uniqueness these input values. For more info please see the tutorials.- Specified by:
getProcessingId
in interfaceSqlControl
- Returns:
- the unique ID of the executed statement based on the input values combination
-
setProcessingId
Sets the unique ID of the executed statement based on input values combination. This ID can be used for the caching purposes to optimize theSqlMetaStatement.process(org.sqlproc.engine.impl.SqlMetaStatement.Type, Object, SqlControl, org.sqlproc.engine.SqlEngine)
The generation of the final ANSI SQL statement from the META SQL statement is influenced by the input values. This ID is an indicator of the uniqueness these input values. For more info please see the tutorials.- Parameters:
processingId
- the unique ID of the executed statement based on input values combination
-
getFetchSize
Returns the fetch size of SQL execution output rows, which can be returned in one SQL statement.- Specified by:
getFetchSize
in interfaceSqlControl
- Returns:
- the fetch size of SQL execution output rows
-
setFetchSize
Sets the fetch size of SQL execution output rows, which can be returned in one SQL statement.- Parameters:
fetchSize
- the fetch size of SQL execution output rows- Returns:
- this instance
-
getSkipEmptyStatement
Returns the indicator, that an empty INSERT or UPDATE statement execution should be ignored (for example update statement without any bounded input values).- Specified by:
getSkipEmptyStatement
in interfaceSqlControl
- Returns:
- the indicator, that an empty INSERT or UPDATE statement execution should be ignored
-
setSkipEmptyStatement
Sets the indicator, that an empty INSERT or UPDATE statement execution should be ignored (for example update statement without any bounded input values).- Parameters:
skipEmptyStatement
- the indicator, that an empty INSERT or UPDATE statement execution should be ignored
-
getLowLevelSqlCallback
Returns the low level SQL callback handler- Specified by:
getLowLevelSqlCallback
in interfaceSqlControl
- Returns:
- the low level SQL callback handler
-
setLowLevelSqlCallback
public SqlStandardControl setLowLevelSqlCallback(SqlControl.LowLevelSqlCallback lowLevelSqlCallback) Sets the low level SQL callback handler.- Parameters:
lowLevelSqlCallback
- the low level SQL callback handler- Returns:
- this instance
-
getSqlExecutionCallback
Returns the SQL command execution callback handler- Specified by:
getSqlExecutionCallback
in interfaceSqlControl
- Returns:
- the SQL command execution callback handler
-
setSqlExecutionCallback
public SqlStandardControl setSqlExecutionCallback(SqlControl.SqlExecutionCallback sqlExecutionCallback) Sets the SQL command execution callback handler.- Parameters:
sqlExecutionCallback
- the SQL command execution callback handler- Returns:
- this instance
-
getSqlName
Returns the name of the required SQL Query Engine instance- Specified by:
getSqlName
in interfaceSqlControl
- Returns:
- the name of the required SQL Query Engine instance
-
setSqlName
Sets the name of the required SQL Query Engine instance- Parameters:
sqlName
- the name of the required SQL Query Engine instance- Returns:
- this instance
-
toString
-