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  int firstResult
          The first SQL execution output row to be returned in the case we need to skip some rows in the result set.
private  int maxResults
          The max number of SQL execution output rows, which can be returned in the result list.
private  int 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  Object staticInputValues
          The object used for the SQL statement dynamic input values.
 
Constructor Summary
SqlStandardControl()
          Standard constructor.
SqlStandardControl(SqlControl sqlControl)
          Merging constructor.
 
Method Summary
 int getFirstResult()
          Returns the first SQL execution output row to be returned in the case we need to skip some rows in the result set.
 int getMaxResults()
          Returns the max number of SQL execution output rows, which can be returned in the result list.
 int 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.
 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 setFirstResult(int 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(int maxResults)
          Sets the max number of SQL execution output rows, which can be returned in the result list.
 SqlStandardControl setMaxTimeout(int 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 setStaticInputValues(Object staticInputValues)
          Sets the object used for the SQL statement static input values.
 String toString()
          
 
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 int 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 int 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 int 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.

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 int 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(int 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 int 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(int 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 int 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(int 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

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.