public class DefaultSqlPlugins extends Object implements IsEmptyPlugin, IsTruePlugin, SqlCountPlugin, SqlFromToPlugin, SqlSequencePlugin, SqlIdentityPlugin, SqlExecutionPlugin, SqlProcessingIdPlugin
SqlFromToPlugin.LimitType
Modifier and Type | Field and Description |
---|---|
protected static String |
CMD_DISTINCT |
private static String |
COUNT_COLNAME |
private static String |
COUNT_TYPE |
(package private) boolean |
debug |
protected static String |
DISTINCT |
protected static String |
FROM |
protected static String |
ID |
protected static int |
L_ID |
protected static int |
L_SELECT |
(package private) org.slf4j.Logger |
logger
The internal slf4j logger.
|
static String |
METHOD_IS_DEF |
static String |
METHOD_IS_DEF_ |
static String |
METHOD_IS_NULL |
static String |
METHOD_IS_NULL_ |
static String |
METHOD_TO_INIT |
static String |
METHOD_TO_INIT_ |
protected static String |
SELECT |
MODIFIER_ANY, MODIFIER_ANYSET, MODIFIER_CALL, MODIFIER_DISCRIMINATOR, MODIFIER_EMPTY, MODIFIER_GTYPE, MODIFIER_ID, MODIFIER_IDENTITY_GENERATOR, MODIFIER_IDENTITY_SELECT, MODIFIER_NOTEMPTY, MODIFIER_NOTNULL, MODIFIER_NULL, MODIFIER_SEQUENCE, MODIFIER_TYPE
Constructor and Description |
---|
DefaultSqlPlugins() |
Modifier and Type | Method and Description |
---|---|
String |
beforeSqlExecution(String name,
String queryString)
Used to possible SQL query/command modification just before it is executed.
|
private Boolean |
callMethod(SqlRuntimeContext runtimeCtx,
String attributeName,
Object parentObj,
Map<String,String> values) |
String |
getProcessingId(String name,
Object dynamicInputValues,
SqlControl sqlControl,
Boolean useDynamicProcessingCache)
Used to construct the unique ID of the executed statement based on the input values combination.
|
String |
identitySelect(SqlRuntimeContext runtimeCtx,
String identitySelectName,
Class<?> inputValueType)
Used to construct the identity SELECT SQL.
|
protected boolean |
isEmpty(Object obj,
Map<String,String> values) |
boolean |
isNotEmpty(SqlRuntimeContext runtimeCtx,
String attributeName,
Object obj,
Object parentObj,
SqlMetaType sqlMetaType,
String inOutModifier,
boolean inSqlSetOrInsert,
Map<String,String> values)
Used for the evaluation of the emptiness in the META SQL fragments.
|
protected boolean |
isNotEmptyInternal(SqlRuntimeContext runtimeCtx,
String attributeName,
Object obj,
Object parentObj,
SqlMetaType sqlMetaType,
String inOutModifier,
boolean inSqlSetOrInsert,
Map<String,String> values)
Used for the evaluation of the emptiness in the META SQL fragments.
|
boolean |
isTrue(SqlRuntimeContext runtimeCtx,
String attributeName,
Object obj,
Object parentObj,
SqlMetaType sqlMetaType,
String inOutModifier,
Map<String,String> values)
Used for the evaluation of the logical expression in the conditional META SQL fragments.
|
SqlFromToPlugin.LimitType |
limitQuery(SqlRuntimeContext runtimeCtx,
String queryString,
StringBuilder queryResult,
Integer firstResult,
Integer maxResults,
boolean ordered)
Used to construct the FROM-TO SQL.
|
private SqlFromToPlugin.LimitType |
limitQuery(String limitPattern,
SqlFromToPlugin.LimitType limitType,
String queryString,
StringBuilder queryResult,
Integer firstResult,
Integer maxResults) |
String |
sequenceSelect(SqlRuntimeContext runtimeCtx,
String sequenceName)
Used to construct the sequence SELECT SQL.
|
String[] |
sqlCount(String name,
StringBuilder sql)
Used to construct the COUNT SQL.
|
final org.slf4j.Logger logger
public static final String METHOD_IS_NULL
public static final String METHOD_IS_NULL_
public static final String METHOD_IS_DEF
public static final String METHOD_IS_DEF_
public static final String METHOD_TO_INIT
public static final String METHOD_TO_INIT_
boolean debug
protected static final String ID
protected static final int L_ID
protected static final String FROM
protected static final String SELECT
protected static final int L_SELECT
protected static final String DISTINCT
protected static final String CMD_DISTINCT
private static final String COUNT_COLNAME
private static final String COUNT_TYPE
public boolean isNotEmpty(SqlRuntimeContext runtimeCtx, String attributeName, Object obj, Object parentObj, SqlMetaType sqlMetaType, String inOutModifier, boolean inSqlSetOrInsert, Map<String,String> values) throws IllegalArgumentException
isNotEmpty
in interface IsEmptyPlugin
runtimeCtx
- the public runtime contextattributeName
- the name of the input valueobj
- the input valueparentObj
- the parent of the input valuesqlMetaType
- the internal type (= META type) devoted for the special processing of the input valuesinOutModifier
- the input/output value modifier devoted to extend the processing of the input/output valuesinSqlSetOrInsert
- an indicator the input value is evaluated in the CRUD statement (INSERT or SET)values
- values for a special identifier handling, for example a sequence for an identityIllegalArgumentException
protected boolean isNotEmptyInternal(SqlRuntimeContext runtimeCtx, String attributeName, Object obj, Object parentObj, SqlMetaType sqlMetaType, String inOutModifier, boolean inSqlSetOrInsert, Map<String,String> values) throws IllegalArgumentException
runtimeCtx
- the public runtime contextattributeName
- the name of the input valueobj
- the input valueparentObj
- the parent of the input valuesqlMetaType
- the internal type (= META type) devoted for the special processing of the input valuesinOutModifier
- the input/output value modifier devoted to extend the processing of the input/output valuesinSqlSetOrInsert
- an indicator the input value is evaluated in the CRUD statement (INSERT or SET)values
- values for a special identifier handling, for example a sequence for an identityIllegalArgumentException
public boolean isTrue(SqlRuntimeContext runtimeCtx, String attributeName, Object obj, Object parentObj, SqlMetaType sqlMetaType, String inOutModifier, Map<String,String> values)
isTrue
in interface IsTruePlugin
runtimeCtx
- the public runtime contextattributeName
- the name of the input valueobj
- the input valueparentObj
- the parent of the input valuesqlMetaType
- the internal type (= META type) devoted for the special processing of the input valuesinOutModifier
- the input/output value modifier devoted to extend the processing of the input/output valuesvalues
- values for a special identifier handling, for example a sequence for an identitypublic String[] sqlCount(String name, StringBuilder sql)
sqlCount
in interface SqlCountPlugin
name
- Name of the META SQL query or statementsql
- original META SQLpublic SqlFromToPlugin.LimitType limitQuery(SqlRuntimeContext runtimeCtx, String queryString, StringBuilder queryResult, Integer firstResult, Integer maxResults, boolean ordered)
limitQuery
in interface SqlFromToPlugin
runtimeCtx
- the public runtime contextqueryString
- the original ANSI SQLqueryResult
- the final ANSI SQL reflected FROM and TO restrictionsfirstResult
- 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.ordered
- the SQL output is sortedSqlQuery.list(SqlRuntimeContext)
private Boolean callMethod(SqlRuntimeContext runtimeCtx, String attributeName, Object parentObj, Map<String,String> values)
private SqlFromToPlugin.LimitType limitQuery(String limitPattern, SqlFromToPlugin.LimitType limitType, String queryString, StringBuilder queryResult, Integer firstResult, Integer maxResults)
public String identitySelect(SqlRuntimeContext runtimeCtx, String identitySelectName, Class<?> inputValueType)
identitySelect
in interface SqlIdentityPlugin
runtimeCtx
- the public runtime contextidentitySelectName
- the identity SELECT SQL nameinputValueType
- a dynamic input value Java typepublic String sequenceSelect(SqlRuntimeContext runtimeCtx, String sequenceName)
sequenceSelect
in interface SqlSequencePlugin
runtimeCtx
- the public runtime contextsequenceName
- the sequence namepublic String beforeSqlExecution(String name, String queryString)
beforeSqlExecution
in interface SqlExecutionPlugin
name
- Name of the META SQL query or statementqueryString
- the SQL query commandpublic String getProcessingId(String name, Object dynamicInputValues, SqlControl sqlControl, Boolean useDynamicProcessingCache)
getProcessingId
in interface SqlProcessingIdPlugin
name
- Name of the META SQL query or statementdynamicInputValues
- the SQL statement dynamic parameters (input values)sqlControl
- The compound parameters controlling the META SQL executionCopyright © 2016. All rights reserved.