|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.pds.StandardDMLGenerator
This class provides a standard implementation for generating datastore
specific Data Manipulation Language (DML) statements.
Supported API: false
Extendable: false
Field Summary | |
private static String |
ADD_ONE
|
private static String |
CLASSNAME
|
protected static String |
CLOSE_HINTS
|
private static String |
COMMA_PLACEHOLDER
|
static boolean |
DEBUG
|
private static String |
EMPTY_BLOB
|
private static HashMap |
FUNCTION_MAP
|
private static Integer |
INITIAL_UPDATE_COUNT
|
private static Integer |
INTEGER_PLACEHOLDER
|
protected static Hashtable |
LOCK_SQL_MAP
|
private static DebugWriter |
LOG
|
private static Long |
LONG_PLACEHOLDER
|
protected static String |
OPEN_HINTS
|
private static HashMap |
PROCEDURE_MAP
|
private static String |
RESOURCE
|
private static String |
VALUES
|
Fields inherited from interface wt.pds.DMLGenerator |
AND, AUTO_NAVI_ALIAS, BIND_PLACEHOLDER, CLOSE_PAREN, COLUMNALIAS_SUFFIX, COMMA, DB_DELIMITER, DELETE, DELETE_FROM, DISTINCT, DUMMY_BINDPARAMETER, DUMMY_TABLE, EQUAL, EQUAL_PLACEHOLDER, ESCAPE, ESCAPE_CHAR, EXISTS, FALSE_CONDITION, FROM, GREATER_THAN, GROUP_BY, HAVING, INNER_JOIN, INSERT_INTO, INTERSECT, LEFT_OUTER_JOIN, MINUS, NOT, NULL, NULL_DATE, NULL_NUMBER, ON, OPEN_PAREN, OR, ORDER_BY, OUTER_JOIN, PLACEHOLDER, RIGHT_OUTER_JOIN, SELECT, SET, SET_EQUAL, SINGLE_QUOTE, SPACE, STRING_BUFFER_INITIAL_LENGTH, TIMESTAMP_FORMAT, TRUE_CONDITION, UNION, UNION_ALL, UPDATE, VIEW_PREFIX, WHERE, ZERO |
Constructor Summary | |
StandardDMLGenerator()
|
Method Summary | |
void |
appendQuote(Object a_value,
StringBuffer a_buffer)
Supported API: false |
ArrayTableExpression[] |
buildArrayTableExpression(String[] selectListArray,
List a_oidList,
int offset,
int count,
int oidCount,
int a_groupFromIndex,
boolean useExtend,
boolean useRowExtension,
int rowExtensionNum,
long a_sessionId)
Supported API: false |
abstract String |
buildArrayTableExpression(String a_alias,
String a_type,
String a_selectList,
Object a_values)
This method is used to build the SQL string for ArrayTableExpression. |
String[] |
buildArrayTableSelectList(int oidCount,
int a_groupFromIndex,
boolean useExtend,
boolean useRowExtension,
int rowExtensionNum)
Supported API: false |
String |
buildAttributeUpdateStatement(Persistable object,
String[] attribute_names)
Supported API: false |
protected static Object |
buildBindParameters_common(StatementSpec a_statementSpec,
WTConnection a_connection)
|
abstract Object |
buildBindParameters(StatementSpec a_statementSpec)
Supported API: false |
String |
buildCall(String a_procedureName,
int a_parameterCount,
boolean a_isFunction)
Supported API: false |
protected abstract String |
buildCallBody(String a_procedureName,
int a_parameterCount,
boolean a_isFunction)
Supported API: false |
protected static StringBuffer |
buildCallParameterList(int a_parameterCount,
StringBuffer a_buffer)
|
String |
buildCompoundStatement(String[] a_sqlStatements,
String a_setOperator,
String a_orderByClause)
Supported API: false |
protected String |
buildConditionForSelect(String a_whereClause,
String a_groupByClause,
String a_havingClause,
String a_orderByClause)
Supported API: false |
protected String |
buildConditionForSelect(String a_whereClause,
String a_groupByClause,
String a_havingClause,
String a_orderByClause,
String a_autoNaviJoinConditions)
Supported API: false |
abstract String |
buildDataStoreProcedureName(String a_procedureName)
Supported API: false |
void |
buildDeleteStatement(ClassInfo a_classInfo,
WhereExpression a_where,
boolean a_useBind,
StringBuffer a_delete)
This method builds a DELETE-WHERE SQL statement. |
String |
buildDummySubSelectStatement(StatementSpec a_statementSpec,
String a_alias)
Supported API: false |
String |
buildEmptyDummySubSelectStatement()
Supported API: false |
protected String |
buildFromForSelect(Vector a_tables,
Vector a_aliases,
ResultBuilder a_resultBuilder,
int[] a_joinOrder,
boolean[] a_fullPersistableTableIndicies,
String a_partialSelect,
JoinClause a_joinClause,
boolean a_useBind)
Supported API: false |
protected abstract String |
buildInsertColumnForSeqeunce(ColumnDescriptor a_sequenceColumn)
Supported API: false |
String |
buildInsertStatement(ClassInfo a_classInfo,
ColumnDescriptor[] a_insertColumns)
Supported API: false |
String |
buildInsertStatement(StatementSpec a_statementSpec,
String tableName,
WTConnection a_connection)
Supported API: false |
String |
buildInsertStatement(String a_tableName,
ColumnDescriptor[] a_insertColumns,
Object[] a_values)
This method builds an INSERT statement. |
abstract String |
buildLockStatement(ClassInfo a_classInfo)
Supported API: false |
protected String |
buildPartialSelect(String a_select,
String a_whereClause,
String a_groupByClause,
String a_havingClause,
String a_orderByClause)
Supported API: false |
abstract String |
buildSelectStatement(Vector a_tables,
Vector a_aliases,
ResultBuilder a_resultBuilder,
boolean a_isDistinct,
String a_select,
String a_whereClause,
String a_groupByClause,
String a_havingClause,
String a_orderByClause,
boolean a_forUpdate,
int[] a_joinOrder,
Vector a_hintsVector,
boolean[] a_fullPersistableTableIndicies,
JoinClause a_joinClause,
boolean a_useBind)
Supported API: false |
protected static String[] |
buildStatements_common(StatementSpec a_statementSpec,
WTConnection a_connection,
boolean a_dummyParameter)
|
abstract String[] |
buildStatements(StatementSpec a_statementSpec,
WTConnection a_connection)
Supported API: false |
String |
buildSubSelectStatement(StatementSpec a_statementSpec,
WTConnection a_connection)
Supported API: false |
abstract String |
buildTableLockStatement(ClassInfo a_classInfo)
Supported API: false |
String |
buildUpdateStatement(ClassInfo a_classInfo,
ColumnDescriptor[] a_columns)
Supported API: false |
protected boolean |
buildUpdateStatement(ClassInfo a_classInfo,
WhereExpression a_where,
boolean a_useBind,
Object[] a_columns,
boolean a_isColumnOnly,
StringBuffer a_buffer)
This method builds the specified UPDATE statement. |
boolean |
buildUpdateStatement(ClassInfo a_classInfo,
WhereExpression a_where,
boolean a_useBind,
UpdateColumnExpression[] a_updateColumns,
StringBuffer a_buffer)
This method builds the specified UPDATE statement. |
private static int |
countCloseParenthesis(String aColumn)
|
private static int |
countOpenParenthesis(String aColumn)
|
protected ClassAttribute |
findTargetClass(Vector args)
|
protected static String |
getArgumentExpression(Vector a_arguments,
int a_index,
boolean a_useBind,
boolean a_validate,
Vector a_tableInfos,
Vector a_aliases,
boolean a_outerJoin)
|
String |
getAutoNaviJoinCondition(Vector a_tables,
Vector a_aliases,
int[] a_joinOrder,
boolean[] a_fullPersistable)
Supported API: false |
String |
getComputedColumnName(String funcName,
Vector args,
Vector a_tableInfos,
Vector a_aliases)
This method returns the computed column name for the function, if it exists. |
protected static String |
getFunctionExpression(String a_sqlFunctionName,
Vector args,
boolean a_useBind,
boolean a_validate,
Vector a_tableInfos,
Vector a_aliases,
boolean a_outerJoin)
|
String |
getFunctionExpression(String funcName,
Vector args,
boolean a_useBind,
Vector a_tableInfos,
Vector a_aliases,
boolean a_outerJoin)
This method returns an expression for the SQL function. |
protected static String |
getInfixExpression(String a_sqlFunctionName,
Vector args,
boolean a_useBind,
boolean a_validate,
Vector a_tableInfos,
Vector a_aliases,
boolean a_outerJoin)
|
protected String |
getInfixExpression(String funcName,
Vector args,
boolean a_useBind,
Vector a_tableInfos,
Vector a_aliases,
boolean a_outerJoin)
This method returns an infix binary expression. |
protected abstract String |
getSQLFunctionName(String a_funcName)
Supported API: false |
protected int[] |
getTableOrder(Vector a_tables,
int[] a_joinOrder)
Supported API: false |
StringBuffer |
quote(Object a_value,
StringBuffer a_buffer)
Supported API: false |
protected static void |
validateArguments(Vector args)
|
protected boolean |
verifyTargetClass(Vector args,
ClassAttribute a_targetClassAttribute)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
public static final boolean DEBUG
private static final DebugWriter LOG
protected static final String OPEN_HINTS
protected static final String CLOSE_HINTS
private static final String VALUES
private static final String EMPTY_BLOB
private static final String ADD_ONE
private static final String COMMA_PLACEHOLDER
protected static final Hashtable LOCK_SQL_MAP
private static final HashMap FUNCTION_MAP
private static final HashMap PROCEDURE_MAP
private static final Integer INITIAL_UPDATE_COUNT
private static final Integer INTEGER_PLACEHOLDER
private static final Long LONG_PLACEHOLDER
Constructor Detail |
public StandardDMLGenerator()
Method Detail |
public String getFunctionExpression(String funcName, Vector args, boolean a_useBind, Vector a_tableInfos, Vector a_aliases, boolean a_outerJoin) throws WTException
getFunctionExpression
in interface DMLGenerator
funcName
- The logic function nameargs
- a_useBind
- a_tableInfos
- a_aliases
- a_outerJoin
-
WTException
protected abstract String getSQLFunctionName(String a_funcName)
a_funcName
-
protected String getInfixExpression(String funcName, Vector args, boolean a_useBind, Vector a_tableInfos, Vector a_aliases, boolean a_outerJoin) throws WTException
funcName
- The logic function nameargs
- a_useBind
- a_tableInfos
- a_aliases
- a_outerJoin
-
WTException
public String getComputedColumnName(String funcName, Vector args, Vector a_tableInfos, Vector a_aliases) throws WTException
getComputedColumnName
in interface DMLGenerator
funcName
- The logic function nameargs
- a_tableInfos
- a_aliases
-
WTException
protected String buildFromForSelect(Vector a_tables, Vector a_aliases, ResultBuilder a_resultBuilder, int[] a_joinOrder, boolean[] a_fullPersistableTableIndicies, String a_partialSelect, JoinClause a_joinClause, boolean a_useBind) throws PersistenceException
a_tables
- a_aliases
- a_resultBuilder
- a_joinOrder
- a_fullPersistableTableIndicies
- a_partialSelect
- a_joinClause
- a_useBind
-
PersistenceException
protected String buildConditionForSelect(String a_whereClause, String a_groupByClause, String a_havingClause, String a_orderByClause)
a_whereClause
- a_groupByClause
- a_havingClause
- a_orderByClause
-
protected String buildPartialSelect(String a_select, String a_whereClause, String a_groupByClause, String a_havingClause, String a_orderByClause)
a_select
- a_whereClause
- a_groupByClause
- a_havingClause
- a_orderByClause
-
public String buildInsertStatement(ClassInfo a_classInfo, ColumnDescriptor[] a_insertColumns) throws PersistenceException
buildInsertStatement
in interface DMLGenerator
a_classInfo
- a_insertColumns
-
PersistenceException
protected abstract String buildInsertColumnForSeqeunce(ColumnDescriptor a_sequenceColumn)
a_sequenceColumn
-
protected abstract String buildCallBody(String a_procedureName, int a_parameterCount, boolean a_isFunction)
a_procedureName
- a_parameterCount
- a_isFunction
-
public String buildCall(String a_procedureName, int a_parameterCount, boolean a_isFunction)
buildCall
in interface DMLGenerator
a_procedureName
- a_parameterCount
- a_isFunction
-
public abstract String buildSelectStatement(Vector a_tables, Vector a_aliases, ResultBuilder a_resultBuilder, boolean a_isDistinct, String a_select, String a_whereClause, String a_groupByClause, String a_havingClause, String a_orderByClause, boolean a_forUpdate, int[] a_joinOrder, Vector a_hintsVector, boolean[] a_fullPersistableTableIndicies, JoinClause a_joinClause, boolean a_useBind) throws PersistenceException
buildSelectStatement
in interface DMLGenerator
a_tables
- a_aliases
- a_resultBuilder
- a_isDistinct
- a_select
- a_whereClause
- a_groupByClause
- a_havingClause
- a_orderByClause
- a_forUpdate
- a_joinOrder
- a_hintsVector
- a_fullPersistableTableIndicies
- a_joinClause
- a_useBind
-
PersistenceException
protected int[] getTableOrder(Vector a_tables, int[] a_joinOrder)
a_tables
- a_joinOrder
-
public String buildCompoundStatement(String[] a_sqlStatements, String a_setOperator, String a_orderByClause) throws PersistenceException
buildCompoundStatement
in interface DMLGenerator
a_sqlStatements
- a_setOperator
- a_orderByClause
-
PersistenceException
public abstract String buildLockStatement(ClassInfo a_classInfo) throws PersistenceException
buildLockStatement
in interface DMLGenerator
a_classInfo
-
PersistenceException
public abstract String buildTableLockStatement(ClassInfo a_classInfo) throws PersistenceException
buildTableLockStatement
in interface DMLGenerator
a_classInfo
-
PersistenceException
public String buildEmptyDummySubSelectStatement() throws WTException
buildEmptyDummySubSelectStatement
in interface DMLGenerator
WTException
public String buildDummySubSelectStatement(StatementSpec a_statementSpec, String a_alias) throws WTException
buildDummySubSelectStatement
in interface DMLGenerator
a_statementSpec
- a_alias
-
WTException
public void buildDeleteStatement(ClassInfo a_classInfo, WhereExpression a_where, boolean a_useBind, StringBuffer a_delete) throws WTException
buildDeleteStatement
in interface DMLGenerator
a_classInfo
- Target class for the delete.a_where
- The WHERE clause to use in the statement.a_useBind
- Indicates if bind parameters should be used.a_delete
- The target string buffer to build the statement in.
WTException
public String buildUpdateStatement(ClassInfo a_classInfo, ColumnDescriptor[] a_columns) throws PersistenceException
buildUpdateStatement
in interface DMLGenerator
a_classInfo
- a_columns
-
PersistenceException
public abstract String buildDataStoreProcedureName(String a_procedureName)
a_procedureName
-
public void appendQuote(Object a_value, StringBuffer a_buffer)
appendQuote
in interface DMLGenerator
a_value
- a_buffer
- public StringBuffer quote(Object a_value, StringBuffer a_buffer)
quote
in interface DMLGenerator
a_value
- a_buffer
-
public ArrayTableExpression[] buildArrayTableExpression(String[] selectListArray, List a_oidList, int offset, int count, int oidCount, int a_groupFromIndex, boolean useExtend, boolean useRowExtension, int rowExtensionNum, long a_sessionId) throws PersistenceException
buildArrayTableExpression
in interface DMLGenerator
selectListArray
- a_oidList
- offset
- count
- oidCount
- a_groupFromIndex
- useExtend
- useRowExtension
- rowExtensionNum
- a_sessionId
-
PersistenceException
public String[] buildArrayTableSelectList(int oidCount, int a_groupFromIndex, boolean useExtend, boolean useRowExtension, int rowExtensionNum) throws PersistenceException
buildArrayTableSelectList
in interface DMLGenerator
oidCount
- a_groupFromIndex
- useExtend
- useRowExtension
- rowExtensionNum
-
PersistenceException
public String buildAttributeUpdateStatement(Persistable object, String[] attribute_names) throws PersistenceException
buildAttributeUpdateStatement
in interface DMLGenerator
object
- attribute_names
-
PersistenceException
public String buildSubSelectStatement(StatementSpec a_statementSpec, WTConnection a_connection) throws WTException
buildSubSelectStatement
in interface DMLGenerator
a_statementSpec
- a_connection
-
WTException
public abstract String[] buildStatements(StatementSpec a_statementSpec, WTConnection a_connection) throws WTException
buildStatements
in interface DMLGenerator
a_statementSpec
- a_connection
-
WTException
public abstract Object buildBindParameters(StatementSpec a_statementSpec) throws WTException
buildBindParameters
in interface DMLGenerator
a_statementSpec
-
WTException
public String buildInsertStatement(StatementSpec a_statementSpec, String tableName, WTConnection a_connection) throws WTException
buildInsertStatement
in interface DMLGenerator
a_statementSpec
- tableName
- a_connection
-
WTException
public String buildInsertStatement(String a_tableName, ColumnDescriptor[] a_insertColumns, Object[] a_values) throws WTException
buildInsertStatement
in interface DMLGenerator
a_tableName
- The table to INSERT into.a_insertColumns
- The columns of the table to INSERT into.a_values
- the values to INSERT. These values correspond to the specified columns. If the array is null, the length of the array is less than the index of an associated column, or the array element is null, then a bind parameter placeholder is used.
WTException
protected String buildConditionForSelect(String a_whereClause, String a_groupByClause, String a_havingClause, String a_orderByClause, String a_autoNaviJoinConditions)
a_whereClause
- a_groupByClause
- a_havingClause
- a_orderByClause
- a_autoNaviJoinConditions
-
public String getAutoNaviJoinCondition(Vector a_tables, Vector a_aliases, int[] a_joinOrder, boolean[] a_fullPersistable) throws PersistenceException
a_tables
- a_aliases
- a_joinOrder
- a_fullPersistable
-
PersistenceException
public boolean buildUpdateStatement(ClassInfo a_classInfo, WhereExpression a_where, boolean a_useBind, UpdateColumnExpression[] a_updateColumns, StringBuffer a_buffer) throws WTException
buildUpdateStatement
in interface DMLGenerator
a_classInfo
- The target class of the statement.a_where
- WhereExpression to use for the statement.a_useBind
- Indicates if bind parameters should be used.a_updateColumns
- Column expressions and values to use in the SET portion of the update statement.a_buffer
- Buffer to build the SQL string into.
WTException
public abstract String buildArrayTableExpression(String a_alias, String a_type, String a_selectList, Object a_values)
buildArrayTableExpression
in interface DMLGenerator
a_alias
- a_type
- a_selectList
- a_values
-
protected boolean buildUpdateStatement(ClassInfo a_classInfo, WhereExpression a_where, boolean a_useBind, Object[] a_columns, boolean a_isColumnOnly, StringBuffer a_buffer) throws WTException
a_classInfo
- The target class of the statement.a_where
- WhereExpression to use for the statement.a_useBind
- Indicates if bind parameters should be used.a_columns
- Column expressions and values to use in the SET
portion of the update statement.a_isColumnOnly
- Indicates the updateColumns are ClassAttributes
only (true), otherwise UpdateColumnExpressions (false).a_buffer
- Buffer to build the SQL string into.
WTException
protected static StringBuffer buildCallParameterList(int a_parameterCount, StringBuffer a_buffer)
protected static String getFunctionExpression(String a_sqlFunctionName, Vector args, boolean a_useBind, boolean a_validate, Vector a_tableInfos, Vector a_aliases, boolean a_outerJoin) throws WTException
WTException
protected static String getInfixExpression(String a_sqlFunctionName, Vector args, boolean a_useBind, boolean a_validate, Vector a_tableInfos, Vector a_aliases, boolean a_outerJoin) throws WTException
WTException
protected static void validateArguments(Vector args) throws WTException
WTException
protected ClassAttribute findTargetClass(Vector args)
protected boolean verifyTargetClass(Vector args, ClassAttribute a_targetClassAttribute) throws WTException
WTException
protected static String getArgumentExpression(Vector a_arguments, int a_index, boolean a_useBind, boolean a_validate, Vector a_tableInfos, Vector a_aliases, boolean a_outerJoin) throws WTException
WTException
private static int countOpenParenthesis(String aColumn)
private static int countCloseParenthesis(String aColumn)
protected static String[] buildStatements_common(StatementSpec a_statementSpec, WTConnection a_connection, boolean a_dummyParameter) throws WTException
WTException
protected static Object buildBindParameters_common(StatementSpec a_statementSpec, WTConnection a_connection) throws WTException
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |