com.webobjects.jdbcadaptor
Class EROracleExpression
java.lang.Object
com.webobjects.eoaccess.EOSQLExpression
com.webobjects.jdbcadaptor.JDBCExpression
com.webobjects.jdbcadaptor.OraclePlugIn.OracleExpression
com.webobjects.jdbcadaptor.EROracleExpression
public class EROracleExpression
- extends OraclePlugIn.OracleExpression
overrides OracleExpression in order to add
TIMESTAMP values including milliseconds. The
normal EOF Oracle PlugIn does not add milliseconds
to the TIMESTAMP value
- Author:
- David Teran
| Fields inherited from class com.webobjects.eoaccess.EOSQLExpression |
_aliasesByRelationshipPath, _bindings, _contextStack, _defaultDateFormatter, _entity, _joinClauseString, _listString, _NibbleToHex, _orderByString, _statement, _upperFunctionName, _useAliases, _valueListString, _whereClauseString, BindVariableAttributeKey, BindVariableColumnKey, BindVariableNameKey, BindVariablePlaceHolderKey, BindVariableValueKey |
|
Method Summary |
void |
addCreateClauseForAttribute(EOAttribute attribute)
|
void |
addOrderByAttributeOrdering(EOSortOrdering sortOrdering)
Overridden to allow the Null Sorting behavior of Oracle to be modified by
setting an application property. |
String |
assembleSelectStatementWithAttributes(NSArray attributes,
boolean lock,
EOQualifier qualifier,
NSArray fetchOrder,
String selectString,
String columnList,
String tableList,
String whereClause,
String joinClause,
String orderByClause,
String lockClause)
Overriden to handle correct placements of join conditions and to handle
DISTINCT fetches with compareCaseInsensitiveA(De)scending sort orders. |
NSMutableDictionary |
bindVariableDictionaryForAttribute(EOAttribute eoattribute,
Object obj)
Overridden in order to add milliseconds to the value. |
String |
formatValueForAttribute(Object obj,
EOAttribute eoattribute)
Overridden in order to add milliseconds to the value. |
boolean |
mustUseBindVariableForAttribute(EOAttribute attribute)
|
void |
prepareConstraintStatementForRelationship(EORelationship relationship,
NSArray sourceColumns,
NSArray destinationColumns)
|
static void |
setDelegate(EROracleExpression.Delegate delegate)
Sets the delegate for this expression. |
protected boolean |
shouldAllowNull(EOAttribute attribute)
|
boolean |
shouldUseBindVariableForAttribute(EOAttribute attribute)
|
boolean |
useBindVariables()
|
| Methods inherited from class com.webobjects.jdbcadaptor.JDBCExpression |
addSelectListAttribute, allowsNullClauseForConstraint, appendItemToListString, appendItemToOrderByString, appendItemToValueListString, columnTypeStringForAttribute, externalNameQuoteCharacter, jdbcInfo, lockClause, prepareSelectExpressionWithAttributes, setJDBCInfo |
| Methods inherited from class com.webobjects.eoaccess.EOSQLExpression |
_aliasForRelatedAttributeRelationshipPath, _aliasForRelationshipPath, _defaultDateFormatter, _entityForRelationshipPathOrigin, _flattenRelPathEntity, _listString, _orderByString, _rootEntityForExpression, _setEntity, _sqlStringForJoinSemanticMatchSemantic, _stringForDate, _truncatedString, _truncatedStringForData, _valueList, addBindVariableDictionary, addInsertListAttribute, addJoinClause, addUpdateListAttribute, aliasesByRelationshipPath, appendItemToListString, assembleDeleteStatementWithQualifier, assembleInsertStatementWithRow, bindVariableDictionaries, entity, formatSQLString, formatStringValue, joinClauseString, joinExpression, listString, orderByString, prepareDeleteExpressionForQualifier, prepareInsertExpressionWithRow, prepareUpdateExpressionWithRow, setStatement, setUseAliases, setUseBindVariables, setUseQuotedExternalNames, sqlEscapeChar, sqlPatternFromShellPattern, sqlPatternFromShellPatternWithEscapeCharacter, sqlStringForAttribute, sqlStringForAttributeNamed, sqlStringForAttributePath, sqlStringForCaseInsensitiveLike, sqlStringForConjoinedQualifiers, sqlStringForData, sqlStringForDisjoinedQualifiers, sqlStringForKeyComparisonQualifier, sqlStringForNegatedQualifier, sqlStringForNumber, sqlStringForQualifier, sqlStringForSchemaObjectName, sqlStringForSelector, sqlStringForString, sqlStringForValue, statement, tableListWithRootEntity, toString, useAliases, useQuotedExternalNames, valueList, whereClauseString |
EROracleExpression
public EROracleExpression(EOEntity eoentity)
setDelegate
public static void setDelegate(EROracleExpression.Delegate delegate)
- Sets the delegate for this expression.
- Parameters:
delegate - the delegate for this expression
shouldAllowNull
protected boolean shouldAllowNull(EOAttribute attribute)
addCreateClauseForAttribute
public void addCreateClauseForAttribute(EOAttribute attribute)
- Overrides:
addCreateClauseForAttribute in class EOSQLExpression
bindVariableDictionaryForAttribute
public NSMutableDictionary bindVariableDictionaryForAttribute(EOAttribute eoattribute,
Object obj)
- Overridden in order to add milliseconds to the value. This
applies only if obj is an instance of NSTimestamp and if
valueType from the eoattribute is T
- Overrides:
bindVariableDictionaryForAttribute in class JDBCExpression
- Parameters:
obj - eoattribute -
- Returns:
- the modified bindVariableDictionary
formatValueForAttribute
public String formatValueForAttribute(Object obj,
EOAttribute eoattribute)
- Overridden in order to add milliseconds to the value. This
applies only if obj is an instance of NSTimestamp and if
valueType from the eoattribute is T
- Overrides:
formatValueForAttribute in class OraclePlugIn.OracleExpression
- Parameters:
obj - eoattribute -
- Returns:
- the modified string
useBindVariables
public boolean useBindVariables()
- Overrides:
useBindVariables in class JDBCExpression
- Returns:
- true to indicate that the Oracle jdbc driver should use
bind variables
shouldUseBindVariableForAttribute
public boolean shouldUseBindVariableForAttribute(EOAttribute attribute)
- Overrides:
shouldUseBindVariableForAttribute in class OraclePlugIn.OracleExpression
- Returns:
- true to indicate that the Oracle jdbc driver should use
bind variables
mustUseBindVariableForAttribute
public boolean mustUseBindVariableForAttribute(EOAttribute attribute)
- Overrides:
mustUseBindVariableForAttribute in class OraclePlugIn.OracleExpression
- Returns:
- true to indicate that the Oracle jdbc driver should use
bind variables
prepareConstraintStatementForRelationship
public void prepareConstraintStatementForRelationship(EORelationship relationship,
NSArray sourceColumns,
NSArray destinationColumns)
- Overrides:
prepareConstraintStatementForRelationship in class OraclePlugIn.OracleExpression
assembleSelectStatementWithAttributes
public String assembleSelectStatementWithAttributes(NSArray attributes,
boolean lock,
EOQualifier qualifier,
NSArray fetchOrder,
String selectString,
String columnList,
String tableList,
String whereClause,
String joinClause,
String orderByClause,
String lockClause)
- Overriden to handle correct placements of join conditions and to handle
DISTINCT fetches with compareCaseInsensitiveA(De)scending sort orders.
Lifted directly from the PostgressExpression.java class.
- Overrides:
assembleSelectStatementWithAttributes in class EOSQLExpression
- Parameters:
attributes - 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 clause
- Returns:
- the select statement
addOrderByAttributeOrdering
public void addOrderByAttributeOrdering(EOSortOrdering sortOrdering)
- Overridden to allow the Null Sorting behavior of Oracle to be modified by
setting an application property. There are three options:
1) Nulls always first, irrespective of sorting:
EROraclePlugIn.nullSortBehavior=NullsFirst
2) Nulls always last, irrespective of sorting (this is Oracle's default):
EROraclePlugIn.nullSortBehavior=NullsLast
3) Nulls as the least or smallest value, the same as EOF:
EROraclePlugIn.nullSortBehavior=EOFStyle.
If you want to use either NullsFirst or NullsLast, you will need to
create a new EOSortOrdering.ComparisonSupport class and set it to be used
at application startup otherwise EOF will still go and resort using nulls
as the smallest value.
- Overrides:
addOrderByAttributeOrdering in class EOSQLExpression
- See Also:
EOSQLExpression.addOrderByAttributeOrdering(com.webobjects.eocontrol.EOSortOrdering)
Copyright © 2002 – 2011 Project Wonder.