public class DB2Expression extends JDBCExpression
| Modifier and Type | Class and Description |
|---|---|
static class |
DB2Expression.JoinClause
Helper class that stores a join definition and
helps
DB2Expression to assemble
the correct join clause. |
EOSQLExpression.SQLValue| Modifier and Type | Field and Description |
|---|---|
protected NSMutableArray<DB2Expression.JoinClause> |
_alreadyJoined
Holds array of join clauses.
|
protected static Method |
_bigDecimalToString
Method to get the string value from a BigDecimals from.
|
protected int |
_fetchLimit
Fetch spec limit ivar
|
protected static NSTimestampFormatter |
DATE_FORMATTER
formatter to use when handling date columns
|
protected static NSTimestampFormatter |
TIMESTAMP_FORMATTER
formatter to use when handling timestamps
|
_externalQuoteChar, _inSelect, _jdbcInfo, _rtrimFunctionName_aliasesByRelationshipPath, _bindings, _contextStack, _defaultDateFormatter, _entity, _joinClauseString, _listString, _NibbleToHex, _orderByString, _statement, _upperFunctionName, _useAliases, _valueListString, _whereClauseString, BindVariableAttributeKey, BindVariableColumnKey, BindVariableNameKey, BindVariablePlaceHolderKey, BindVariableValueKey| Constructor and Description |
|---|
DB2Expression(EOEntity entity)
Overridden to remove the rtrim usage.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCreateClauseForAttribute(EOAttribute attribute) |
void |
addJoinClause(String leftName,
String rightName,
int semantic)
Overridden to not call the super implementation.
|
String |
allowsNullClauseForConstraint(boolean allowsNull)
cug: Quick hack for bug in WebObjects 5.4 where the "not null" statement is added without a space,
and "addCreateClauseForAttribute" is not called anymore.
|
String |
assembleJoinClause(String leftName,
String rightName,
int semantic)
Overridden to construct a valid SQL92 JOIN clause as opposed to
the Oracle-like SQL the superclass produces.
|
String |
assembleSelectStatementWithAttributes(NSArray attributes,
boolean lock,
EOQualifier qualifier,
NSArray fetchOrder,
String selectString,
String columnList,
String tableList,
String whereClause,
String joinClause,
String orderByClause,
String lockClause)
Overridden to handle correct placements of join conditions and
to handle DISTINCT fetches with compareCaseInsensitiveA(De)scending sort orders.
|
NSMutableDictionary<String,Object> |
bindVariableDictionaryForAttribute(EOAttribute eoattribute,
Object obj)
Overridden to fix an issue with NStimestamp classes and "T" value-typed attributes.
|
String |
formatValueForAttribute(Object obj,
EOAttribute eoattribute)
Overridden because the original version throws when the
data contains negative byte values.
|
String |
joinClauseString()
Overrides the parent implementation to compose the final string
expression for the join clauses.
|
boolean |
mustUseBindVariableForAttribute(EOAttribute attribute)
Overridden to return true only if bind variables are enabled or the is a data type.
|
void |
prepareConstraintStatementForRelationship(EORelationship relationship,
NSArray sourceColumns,
NSArray destinationColumns)
cug: Also handles identifier quoting now
|
void |
prepareSelectExpressionWithAttributes(NSArray<EOAttribute> attributes,
boolean lock,
EOFetchSpecification eofetchspecification)
Overridden so we can get the fetch limit from the fetchSpec.
|
static String |
replaceStringByStringInString(String old,
String newString,
String buffer)
Replaces a given string by another string in a string.
|
void |
setUseBindVariables(boolean value)
Overridden to set the
disableBindVariables value correctly. |
protected boolean |
shouldAllowNull(EOAttribute attribute) |
boolean |
shouldUseBindVariableForAttribute(EOAttribute attribute)
Overridden to return true only if bind variables are enabled or the is a data type.
|
String |
sqlStringForAttribute(EOAttribute attribute)
Overridden because the original version does not correctly quote mixed case fields in all cases.
|
String |
tableListWithRootEntity(EOEntity entity)
Overridden because the original version does not correctly quote mixed case table names in all cases.
|
boolean |
useBindVariables()
Overridden to return the negated value of
disableBindVariables. |
addSelectListAttribute, appendItemToListString, appendItemToOrderByString, appendItemToValueListString, columnTypeStringForAttribute, externalNameQuoteCharacter, jdbcInfo, lockClause, setJDBCInfo_aliasForRelatedAttributeRelationshipPath, _aliasForRelationshipPath, _defaultDateFormatter, _entityForRelationshipPathOrigin, _flattenRelPathEntity, _listString, _orderByString, _rootEntityForExpression, _setEntity, _sqlStringForJoinSemanticMatchSemantic, _stringForDate, _truncatedString, _truncatedStringForData, _valueList, addBindVariableDictionary, addInsertListAttribute, addOrderByAttributeOrdering, addUpdateListAttribute, aliasesByRelationshipPath, appendItemToListString, assembleDeleteStatementWithQualifier, assembleInsertStatementWithRow, assembleUpdateStatementWithRow, bindVariableDictionaries, entity, formatSQLString, formatStringValue, joinExpression, listString, orderByString, prepareDeleteExpressionForQualifier, prepareInsertExpressionWithRow, prepareUpdateExpressionWithRow, setStatement, setUseAliases, setUseQuotedExternalNames, sqlEscapeChar, sqlPatternFromShellPattern, sqlPatternFromShellPatternWithEscapeCharacter, sqlStringForAttributeNamed, sqlStringForAttributePath, sqlStringForCaseInsensitiveLike, sqlStringForConjoinedQualifiers, sqlStringForData, sqlStringForDisjoinedQualifiers, sqlStringForKeyComparisonQualifier, sqlStringForKeyValueQualifier, sqlStringForNegatedQualifier, sqlStringForNumber, sqlStringForQualifier, sqlStringForSchemaObjectName, sqlStringForSelector, sqlStringForString, sqlStringForValue, statement, toString, useAliases, useQuotedExternalNames, valueList, whereClauseStringprotected static final NSTimestampFormatter DATE_FORMATTER
protected static final NSTimestampFormatter TIMESTAMP_FORMATTER
protected static Method _bigDecimalToString
protected NSMutableArray<DB2Expression.JoinClause> _alreadyJoined
protected int _fetchLimit
public DB2Expression(EOEntity entity)
entity - entity for this expressionpublic NSMutableDictionary<String,Object> bindVariableDictionaryForAttribute(EOAttribute eoattribute, Object obj)
bindVariableDictionaryForAttribute in class JDBCExpressionpublic void addJoinClause(String leftName, String rightName, int semantic)
addJoinClause in class EOSQLExpressionleftName - the table name on the left side of the clauserightName - the table name on the right side of the clausesemantic - the join semanticpublic String assembleJoinClause(String leftName, String rightName, int semantic)
assembleJoinClause in class EOSQLExpressionleftName - the table name on the left side of the clauserightName - the table name on the right side of the clausesemantic - the join semanticpublic String assembleSelectStatementWithAttributes(NSArray attributes, boolean lock, EOQualifier qualifier, NSArray fetchOrder, String selectString, String columnList, String tableList, String whereClause, String joinClause, String orderByClause, String lockClause)
assembleSelectStatementWithAttributes in class EOSQLExpressionattributes - the attributes to selectlock - flag for locking rows in the databasequalifier - the qualifier to restrict the selectionfetchOrder - specifies the fetch ordercolumnList - the SQL columns to be fetchedtableList - the the SQL tables to be fetchedwhereClause - the SQL where clausejoinClause - the SQL join clauseorderByClause - the SQL sort order clauselockClause - the SQL lock clausepublic String formatValueForAttribute(Object obj, EOAttribute eoattribute)
formatValueForAttribute in class JDBCExpressionobj - the object used in the SQL statementeoattribute - the attribute associated with objpublic String joinClauseString()
joinClauseString in class EOSQLExpressionpublic void prepareConstraintStatementForRelationship(EORelationship relationship, NSArray sourceColumns, NSArray destinationColumns)
prepareConstraintStatementForRelationship in class EOSQLExpressionrelationship - the relationshipsourceColumns - the source columns for the constraintsdestinationColumns - the destination columns for the constraintspublic void prepareSelectExpressionWithAttributes(NSArray<EOAttribute> attributes, boolean lock, EOFetchSpecification eofetchspecification)
prepareSelectExpressionWithAttributes in class JDBCExpressionattributes - the array of attributeslock - locking flageofetchspecification - the fetch specificationprotected boolean shouldAllowNull(EOAttribute attribute)
public void addCreateClauseForAttribute(EOAttribute attribute)
addCreateClauseForAttribute in class EOSQLExpressionpublic String allowsNullClauseForConstraint(boolean allowsNull)
allowsNullClauseForConstraint in class JDBCExpressionpublic String sqlStringForAttribute(EOAttribute attribute)
sqlStringForAttribute in class EOSQLExpressionattribute - the attribute (column name) to be converted to a SQL stringpublic String tableListWithRootEntity(EOEntity entity)
tableListWithRootEntity in class EOSQLExpressionpublic boolean useBindVariables()
disableBindVariables.useBindVariables in class JDBCExpressionpublic void setUseBindVariables(boolean value)
disableBindVariables value correctly.setUseBindVariables in class EOSQLExpressionvalue - new valuepublic boolean shouldUseBindVariableForAttribute(EOAttribute attribute)
shouldUseBindVariableForAttribute in class JDBCExpressionpublic boolean mustUseBindVariableForAttribute(EOAttribute attribute)
mustUseBindVariableForAttribute in class JDBCExpressionpublic static String replaceStringByStringInString(String old, String newString, String buffer)
old - string to be replacednewString - to be insertedbuffer - string to have the replacement done on itCopyright © 2002 – 2025 Project Wonder.