public class SqlProcessContext extends Object
SqlMetaStatement.process(org.sqlproc.engine.impl.SqlMetaStatement.Type, Object, Object, List, Map, Map, SqlTypeFactory, SqlPluginFactory)
Also can work as a context for a dynamic ANSI SQL query generation. This processing is based on the contract
SqlMetaElement.process(SqlProcessContext)
.Modifier and Type | Field and Description |
---|---|
private static ThreadLocal<Map<String,Object>> |
currentFeatures
The thread local holder for the configuration object.
|
private static ThreadLocal<SqlPluginFactory> |
currentPluginFactory
The thread local holder for the factory for the SQL Processor plugins.
|
private static ThreadLocal<SqlTypeFactory> |
currentTypeFactory
The thread local holder for the factory responsible for the META types construction.
|
(package private) 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) List<SqlOrder> |
order
The list of ordering directives.
|
(package private) SqlMetaStatement.Type |
sqlStatementType
The SQL command type.
|
(package private) Object |
staticInputValues
The SQL statement static parameters.
|
Constructor and Description |
---|
SqlProcessContext(SqlMetaStatement.Type sqlStatementType,
Object dynamicInputValues,
Object staticInputValues,
List<SqlOrder> order,
Map<String,Object> features,
Map<String,Object> runtimeFeatures,
SqlTypeFactory typeFactory,
SqlPluginFactory pluginFactory)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
static String |
getFeature(String name)
Convenient method to obtain a String feature based on the name.
|
static Integer |
getFeatureAsInt(String name)
Convenient method to obtain an Integer feature based on the name.
|
static Object |
getFeatureAsObject(String name)
Convenient method to obtain an Object feature based on the name.
|
(package private) static Map<String,Object> |
getFeatures()
Returns the features for the current thread.
|
static String[] |
getFeatures(String name)
Convenient method to obtain a String array features based on the name.
|
(package private) SqlOrder.Order |
getOrder(int orderIndex)
Convenient method to obtain the ordering directive based on the index.
|
(package private) int |
getOrderIndex(int orderId)
Convenient method to obtain the index of the ordering directive.
|
static SqlPluginFactory |
getPluginFactory()
Returns the factory for the current thread responsible for the SQL Processor plugins.
|
SqlMetaStatement.Type |
getSqlStatementType() |
static SqlTypeFactory |
getTypeFactory()
Returns the factory for the current thread responsible for the META types construction.
|
static boolean |
isFeature(String name)
Convenient method to obtain a boolean feature based on the name.
|
(package private) static void |
nullFeatures()
THIS METHOD IS NOT PART OF THE SQL PROCESSOR PUBLIC API.
|
(package private) static void |
nullPluginFactory()
THIS METHOD IS NOT PART OF THE SQL PROCESSOR PUBLIC API.
|
(package private) static void |
nullTypeFactory()
THIS METHOD IS NOT PART OF THE SQL PROCESSOR PUBLIC API.
|
(package private) static void |
setFeatures(Map<String,Object> features,
Map<String,Object> runtimeFeatures)
THIS METHOD IS NOT PART OF THE SQL PROCESSOR PUBLIC API.
|
(package private) static void |
setPluginFactory(SqlPluginFactory pluginFactory)
THIS METHOD IS NOT PART OF THE SQL PROCESSOR PUBLIC API.
|
(package private) static void |
setTypeFactory(SqlTypeFactory typeFactory)
THIS METHOD IS NOT PART OF THE SQL PROCESSOR PUBLIC API.
|
SqlMetaStatement.Type sqlStatementType
Object dynamicInputValues
Object staticInputValues
boolean inSqlSetOrInsert
private static final ThreadLocal<Map<String,Object>> currentFeatures
private static final ThreadLocal<SqlTypeFactory> currentTypeFactory
private static final ThreadLocal<SqlPluginFactory> currentPluginFactory
SqlProcessContext(SqlMetaStatement.Type sqlStatementType, Object dynamicInputValues, Object staticInputValues, List<SqlOrder> order, Map<String,Object> features, Map<String,Object> runtimeFeatures, SqlTypeFactory typeFactory, SqlPluginFactory pluginFactory)
sqlStatementType
- the type of the SQL commanddynamicInputValues
- the dynamic input parametersstaticInputValues
- the static input parametersorder
- the list of ordering directivesfeatures
- the optional features in the statement/global scoperuntimeFeatures
- the optional features in the statement's exection scopetypeFactory
- the factory for the META types constructionpluginFactory
- the factory for the SQL Processor pluginspublic SqlMetaStatement.Type getSqlStatementType()
public static String getFeature(String name)
name
- name of the featurepublic static String[] getFeatures(String name)
name
- name of the featurepublic static boolean isFeature(String name)
name
- name of the featurepublic static Integer getFeatureAsInt(String name)
name
- name of the featurepublic static Object getFeatureAsObject(String name)
name
- name of the featureint getOrderIndex(int orderId)
orderId
- the order numberSqlOrder.Order getOrder(int orderIndex)
orderIndex
- the index of the ordering rulestatic Map<String,Object> getFeatures()
static void setFeatures(Map<String,Object> features, Map<String,Object> runtimeFeatures)
features
- the optional features in the statement/global scoperuntimeFeatures
- the optional features in the statement's exection scopestatic void nullFeatures()
public static SqlTypeFactory getTypeFactory()
static void setTypeFactory(SqlTypeFactory typeFactory)
typeFactory
- the factory for the META types constructionstatic void nullTypeFactory()
public static SqlPluginFactory getPluginFactory()
static void setPluginFactory(SqlPluginFactory pluginFactory)
pluginFactory
- the factory for the SQL Processor pluginsstatic void nullPluginFactory()
Copyright © 2014. All Rights Reserved.