org.sqlproc.engine.impl
Class SqlStandardControl

java.lang.Object
  extended by org.sqlproc.engine.impl.SqlStandardControl
All Implemented Interfaces:
SqlControl

public class SqlStandardControl
extends Object
implements SqlControl

The compound parameters controlling the META SQL execution.

For more info please see the Tutorials.

Author:
Vladimir Hudec

Field Summary
private  Map<String,Object> features
          The optional features.
private  Integer fetchSize
          Returns the fetch size of SQL execution output rows, which can be returned in one SQL statement.
private  Integer firstResult
          The first SQL execution output row to be returned in the case we need to skip some rows in the result set.
private  Integer maxResults
          The max number of SQL execution output rows, which can be returned in the result list.
private  Integer maxTimeout
          The max SQL execution time.
private  Map<String,Class<?>> moreResultClasses
          More result classes used for the return values, like the collections classes or the collections items.
private  SqlOrder order
          The ordering directive list.
private  String processingId
          The unique ID of the executed statement based on input values combination.
private  Object staticInputValues
          The object used for the SQL statement dynamic input values.
 
Constructor Summary
SqlStandardControl()
          Standard constructor.
SqlStandardControl(SqlControl sqlControl)
          Merging constructor.
 
Method Summary
 Map<String,Object> getFeatures()
          Returns the optional features.
 Integer getFetchSize()
          Returns the fetch size of SQL execution output rows, which can be returned in one SQL statement.
 Integer getFirstResult()
          Returns the first SQL execution output row to be returned in the case we need to skip some rows in the result set.
 Integer getMaxResults()
          Returns the max number of SQL execution output rows, which can be returned in the result list.
 Integer getMaxTimeout()
          Returns the max SQL execution time.
 Map<String,Class<?>> getMoreResultClasses()
          Returns more result classes used for the return values, like the collections classes or the collections items.
 SqlOrder getOrder()
          Returns the ordering directive list.
 String getProcessingId()
          Returns the unique ID of the executed statement based on the input values combination.
 Object getStaticInputValues()
          Returns the object used for the SQL statement static input values.
 SqlStandardControl setAscOrder(int order)
          Sets the ordering directive list.
 SqlStandardControl setDescOrder(int order)
          Sets the ordering directive list.
 SqlStandardControl setFeature(String name, Object value)
          Sets the optional feature in the stament's execution scope.
 SqlStandardControl setFeatures(Map<String,Object> features)
          Sets the optional features.
 SqlStandardControl setFetchSize(Integer fetchSize)
          Sets the fetch size of SQL execution output rows, which can be returned in one SQL statement.
 SqlStandardControl 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.
 SqlStandardControl setMaxResults(Integer maxResults)
          Sets the max number of SQL execution output rows, which can be returned in the result list.
 SqlStandardControl setMaxTimeout(Integer maxTimeout)
          Sets the max SQL execution time.
 SqlStandardControl setMoreResultClasses(Map<String,Class<?>> moreResultClasses)
          Sets more result classes used for the return values, like the collections classes or the collections items.
 SqlStandardControl setOrder(SqlOrder order)
          Sets the ordering directive list.
 SqlStandardControl setProcessingId(String processingId)
          Sets the unique ID of the executed statement based on input values combination.
 SqlStandardControl setStaticInputValues(Object staticInputValues)
          Sets the object used for the SQL statement static input values.
 String toString()
          
 SqlStandardControl unsetFeatures(Set<String> names)
          Clears the optional features in the stament's or execution scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

staticInputValues

private Object 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.


maxTimeout

private Integer 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

private Integer 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

private Integer 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

private SqlOrder 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

private Map<String,Class<?>> 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

private Map<String,Object> 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

private String processingId
The unique ID of the executed statement based on input values combination. This ID can be used for the caching purposes to optimize the SqlMetaStatement.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

private Integer fetchSize
Returns the fetch size of SQL execution output rows, which can be returned in one SQL statement.

Constructor Detail

SqlStandardControl

public SqlStandardControl()
Standard constructor.


SqlStandardControl

public SqlStandardControl(SqlControl sqlControl)
Merging constructor.

Method Detail

getStaticInputValues

public Object 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 interface SqlControl
Returns:
the object used for the SQL statement static input values

setStaticInputValues

public SqlStandardControl setStaticInputValues(Object staticInputValues)
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

getMaxTimeout

public Integer 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 interface SqlControl
Returns:
the max SQL execution time

setMaxTimeout

public SqlStandardControl setMaxTimeout(Integer maxTimeout)
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

public Integer 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 interface SqlControl
Returns:
the first SQL execution output row

setFirstResult

public SqlStandardControl 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. The primary usage is to support the pagination.

Parameters:
firstResult - the first SQL execution output row
Returns:
this instance

getMaxResults

public Integer 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 interface SqlControl
Returns:
the max number of SQL execution output rows

setMaxResults

public SqlStandardControl setMaxResults(Integer maxResults)
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

public SqlOrder 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 interface SqlControl
Returns:
the ordering directive list

setOrder

public SqlStandardControl setOrder(SqlOrder order)
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

public SqlStandardControl setAscOrder(int order)
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

public SqlStandardControl setDescOrder(int order)
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

public Map<String,Class<?>> 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 interface SqlControl
Returns:
more result classes used for the return values

setMoreResultClasses

public SqlStandardControl setMoreResultClasses(Map<String,Class<?>> moreResultClasses)
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

public Map<String,Object> 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 interface SqlControl
Returns:
the optional features

setFeatures

public SqlStandardControl setFeatures(Map<String,Object> features)
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

public SqlStandardControl setFeature(String name,
                                     Object value)
Sets the optional feature in the stament's execution scope.

Parameters:
name - the name of the optional feature
value - the value of the optional feature

unsetFeatures

public SqlStandardControl unsetFeatures(Set<String> names)
Clears the optional features in the stament's or execution scope.

Parameters:
names - the names of the optional features

getProcessingId

public String 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 the SqlMetaStatement.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 interface SqlControl
Returns:
the unique ID of the executed statement based on the input values combination

setProcessingId

public SqlStandardControl setProcessingId(String processingId)
Sets the unique ID of the executed statement based on input values combination. This ID can be used for the caching purposes to optimize the SqlMetaStatement.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

public Integer getFetchSize()
Description copied from interface: SqlControl
Returns the fetch size of SQL execution output rows, which can be returned in one SQL statement.

Specified by:
getFetchSize in interface SqlControl
Returns:
the fetch size of SQL execution output rows

setFetchSize

public SqlStandardControl setFetchSize(Integer fetchSize)
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

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2015. All rights reserved.