org.sqlproc.engine.impl
Class SqlProcessContext

java.lang.Object
  extended by org.sqlproc.engine.impl.SqlProcessContext

 class SqlProcessContext
extends java.lang.Object

The crate (design pattern) for all input parameters for SqlMetaStatement.process(org.sqlproc.engine.impl.SqlMetaStatement.Type, Object, Object, List, Map) . Also can work as a context for a dynamic ANSI SQL Query generation. This processing is based on the contract SqlMetaElement.process(SqlProcessContext).

Author:
Vladimir Hudec

Field Summary
private static java.lang.ThreadLocal<java.util.Map<java.lang.String,java.lang.Object>> currentFeatures
          Thread local holder of the configuration object.
(package private)  java.lang.Object dynamicInputValues
          The SQL statement dynamic parameters.
(package private)  boolean inSqlSetOrInsert
          An indicator, that the processing is inside of the special SQL fragment - SET or VALUES.
(package private)  java.util.List<SqlOrder> order
          The list of ordering directives.
(package private)  SqlMetaStatement.Type sqlStatementType
          The SQL command type.
(package private)  java.lang.Object staticInputValues
          The SQL statement static parameters.
 
Constructor Summary
SqlProcessContext(SqlMetaStatement.Type sqlStatementType, java.lang.Object dynamicInputValues, java.util.List<SqlOrder> order, java.util.Map<java.lang.String,java.lang.Object> features)
          Creates a new instance with empty static input values.
SqlProcessContext(SqlMetaStatement.Type sqlStatementType, java.lang.Object dynamicInputValues, java.lang.Object staticInputValues, java.util.List<SqlOrder> order, java.util.Map<java.lang.String,java.lang.Object> features)
          Creates a new instance.
 
Method Summary
(package private) static java.lang.String getFeature(java.lang.String name)
          Convenient method to obtain String feature based on the name.
(package private) static java.lang.Integer getFeatureAsInt(java.lang.String name)
          Convenient method to obtain Integer feature based on the name.
(package private) static java.util.Map<java.lang.String,java.lang.Object> getFeatures()
          Returns the features for current thread.
(package private) static java.lang.String[] getFeatures(java.lang.String name)
          Convenient method to obtain String array features based on the name.
(package private)  SqlOrder.Order getOrder(int orderIndex)
          Convenient method to obtain the ordering rule based on index.
(package private)  int getOrderIndex(int orderId)
          Convenient method to obtain the index of the ordering rule.
(package private) static boolean isFeature(java.lang.String name)
          Convenient method to obtain boolean feature based on the name.
(package private) static void set(java.util.Map<java.lang.String,java.lang.Object> features)
          THIS METHOD IS NOT PART OF THE SQL PROCESSOR PUBLIC API.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sqlStatementType

SqlMetaStatement.Type sqlStatementType
The SQL command type.


dynamicInputValues

java.lang.Object dynamicInputValues
The SQL statement dynamic parameters.


staticInputValues

java.lang.Object staticInputValues
The SQL statement static parameters.


order

java.util.List<SqlOrder> order
The list of ordering directives.


inSqlSetOrInsert

boolean inSqlSetOrInsert
An indicator, that the processing is inside of the special SQL fragment - SET or VALUES.


currentFeatures

private static final java.lang.ThreadLocal<java.util.Map<java.lang.String,java.lang.Object>> currentFeatures
Thread local holder of the configuration object.

Constructor Detail

SqlProcessContext

SqlProcessContext(SqlMetaStatement.Type sqlStatementType,
                  java.lang.Object dynamicInputValues,
                  java.util.List<SqlOrder> order,
                  java.util.Map<java.lang.String,java.lang.Object> features)
Creates a new instance with empty static input values.

Parameters:
sqlStatementType - the type of SQL command
dynamicInputValues - the dynamic input values
order - the ordering rules
features - the optional features

SqlProcessContext

SqlProcessContext(SqlMetaStatement.Type sqlStatementType,
                  java.lang.Object dynamicInputValues,
                  java.lang.Object staticInputValues,
                  java.util.List<SqlOrder> order,
                  java.util.Map<java.lang.String,java.lang.Object> features)
Creates a new instance.

Parameters:
sqlStatementType - the type of SQL command
dynamicInputValues - the dynamic input values
staticInputValues - the static input values
order - the ordering rules
features - the optional features
Method Detail

getFeature

static java.lang.String getFeature(java.lang.String name)
Convenient method to obtain String feature based on the name.

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

getFeatures

static java.lang.String[] getFeatures(java.lang.String name)
Convenient method to obtain String array features based on the name.

Parameters:
name - name of the feature
Returns:
the array of feature values

isFeature

static boolean isFeature(java.lang.String name)
Convenient method to obtain boolean feature based on the name.

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

getFeatureAsInt

static java.lang.Integer getFeatureAsInt(java.lang.String name)
Convenient method to obtain Integer feature based on the name.

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

getOrderIndex

int getOrderIndex(int orderId)
Convenient method to obtain the index of the ordering rule.

Parameters:
orderId - order number
Returns:
index of the ordering rule

getOrder

SqlOrder.Order getOrder(int orderIndex)
Convenient method to obtain the ordering rule based on index.

Parameters:
orderIndex - index of the ordering rule
Returns:
ordering rule

getFeatures

static java.util.Map<java.lang.String,java.lang.Object> getFeatures()
Returns the features for current thread.

Returns:
the current thread's features

set

static void set(java.util.Map<java.lang.String,java.lang.Object> features)
THIS METHOD IS NOT PART OF THE SQL PROCESSOR PUBLIC API. DO NOT USE IT.

Parameters:
features - the current features or null for this thread


Copyright © 2011. All Rights Reserved.