|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sqlproc.engine.plugin.DefaultSqlPlugins
public class DefaultSqlPlugins
The SQL Processor plugins standard implementation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.sqlproc.engine.plugin.SqlFromToPlugin |
|---|
SqlFromToPlugin.LimitType |
| Field Summary | |
|---|---|
(package private) boolean |
debug
|
(package private) org.slf4j.Logger |
logger
The internal slf4j logger. |
| Fields inherited from interface org.sqlproc.engine.plugin.Modifiers |
|---|
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 Summary | |
|---|---|
DefaultSqlPlugins()
|
|
| Method Summary | |
|---|---|
String |
beforeSqlExecution(String name,
String queryString)
Used to possible SQL query/command modification just before it is executed. |
private Boolean |
callMethod(String attributeName,
Object parentObj,
Map<String,String> values)
|
String |
identitySelect(String identitySelectName,
Class<?> inputValueType)
Used to construct the identity SELECT SQL. |
protected boolean |
isEmpty(Object obj,
Map<String,String> values)
|
boolean |
isNotEmpty(String attributeName,
Object obj,
Object parentObj,
SqlMetaType sqlMetaType,
String inOutModifier,
boolean inSqlSetOrInsert,
Map<String,String> values,
Map<String,Object> features)
Used for the evaluation of the emptiness in the META SQL fragments. |
protected boolean |
isNotEmptyInternal(String attributeName,
Object obj,
Object parentObj,
SqlMetaType sqlMetaType,
String inOutModifier,
boolean inSqlSetOrInsert,
Map<String,String> values,
Map<String,Object> features)
Used for the evaluation of the emptiness in the META SQL fragments. |
boolean |
isTrue(String attributeName,
Object obj,
Object parentObj,
SqlMetaType sqlMetaType,
String inOutModifier,
Map<String,String> values,
Map<String,Object> features)
Used for the evaluation of the logical expression in the conditional META SQL fragments. |
private SqlFromToPlugin.LimitType |
limitQuery(String limitPattern,
SqlFromToPlugin.LimitType limitType,
String queryString,
StringBuilder queryResult,
Integer firstResult,
Integer maxResults)
|
SqlFromToPlugin.LimitType |
limitQuery(String queryString,
StringBuilder queryResult,
Integer firstResult,
Integer maxResults,
boolean ordered)
Used to construct the FROM-TO SQL. |
String |
sequenceSelect(String sequenceName)
Used to construct the sequence SELECT SQL. |
String |
sqlCount(StringBuilder sql)
Used to construct the COUNT SQL. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final org.slf4j.Logger logger
boolean debug
| Constructor Detail |
|---|
public DefaultSqlPlugins()
| Method Detail |
|---|
public boolean isNotEmpty(String attributeName,
Object obj,
Object parentObj,
SqlMetaType sqlMetaType,
String inOutModifier,
boolean inSqlSetOrInsert,
Map<String,String> values,
Map<String,Object> features)
throws IllegalArgumentException
isNotEmpty in interface IsEmptyPluginattributeName - 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 identityfeatures - the optional features in the statement coontext
IllegalArgumentException
protected boolean isNotEmptyInternal(String attributeName,
Object obj,
Object parentObj,
SqlMetaType sqlMetaType,
String inOutModifier,
boolean inSqlSetOrInsert,
Map<String,String> values,
Map<String,Object> features)
throws IllegalArgumentException
attributeName - 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 identityfeatures - the optional features in the statement coontext
IllegalArgumentException
protected boolean isEmpty(Object obj,
Map<String,String> values)
public boolean isTrue(String attributeName,
Object obj,
Object parentObj,
SqlMetaType sqlMetaType,
String inOutModifier,
Map<String,String> values,
Map<String,Object> features)
isTrue in interface IsTruePluginattributeName - 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 identityfeatures - the optional features in the statement coontext
public String sqlCount(StringBuilder sql)
sqlCount in interface SqlCountPluginsql - original META SQL
public SqlFromToPlugin.LimitType limitQuery(String queryString,
StringBuilder queryResult,
Integer firstResult,
Integer maxResults,
boolean ordered)
limitQuery in interface SqlFromToPluginqueryString - 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 sorted
SqlQuery.list()
private Boolean callMethod(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(String identitySelectName,
Class<?> inputValueType)
identitySelect in interface SqlIdentityPluginidentitySelectName - the identity SELECT SQL nameinputValueType - a dynamic input value Java type
public String sequenceSelect(String sequenceName)
sequenceSelect in interface SqlSequencePluginsequenceName - the sequence name
public String beforeSqlExecution(String name,
String queryString)
beforeSqlExecution in interface SqlExecutionPluginname - Name of the META SQL query or statementqueryString - the SQL query command
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||