Project Wonder 5.0

com.webobjects.jdbcadaptor
Class EROracleExpression

java.lang.Object
  extended by com.webobjects.eoaccess.EOSQLExpression
      extended by com.webobjects.jdbcadaptor.JDBCExpression
          extended by com.webobjects.jdbcadaptor.OraclePlugIn.OracleExpression
              extended by com.webobjects.jdbcadaptor.EROracleExpression

public class EROracleExpression
extends com.webobjects.jdbcadaptor.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

Nested Class Summary
static interface EROracleExpression.Delegate
           
 
Nested classes/interfaces inherited from class com.webobjects.eoaccess.EOSQLExpression
com.webobjects.eoaccess.EOSQLExpression.SQLValue
 
Field Summary
 
Fields inherited from class com.webobjects.jdbcadaptor.JDBCExpression
_externalQuoteChar, _inSelect, _jdbcInfo, _rtrimFunctionName
 
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
 
Constructor Summary
EROracleExpression(com.webobjects.eoaccess.EOEntity eoentity)
           
 
Method Summary
 void addCreateClauseForAttribute(com.webobjects.eoaccess.EOAttribute attribute)
           
 void addOrderByAttributeOrdering(com.webobjects.eocontrol.EOSortOrdering sortOrdering)
          Overridden to allow the Null Sorting behavior of Oracle to be modified by setting an application property.
 java.lang.String assembleSelectStatementWithAttributes(com.webobjects.foundation.NSArray attributes, boolean lock, com.webobjects.eocontrol.EOQualifier qualifier, com.webobjects.foundation.NSArray fetchOrder, java.lang.String selectString, java.lang.String columnList, java.lang.String tableList, java.lang.String whereClause, java.lang.String joinClause, java.lang.String orderByClause, java.lang.String lockClause)
          Overriden to handle correct placements of join conditions and to handle DISTINCT fetches with compareCaseInsensitiveA(De)scending sort orders.
 com.webobjects.foundation.NSMutableDictionary bindVariableDictionaryForAttribute(com.webobjects.eoaccess.EOAttribute eoattribute, java.lang.Object obj)
          Overridden in order to add milliseconds to the value.
 java.lang.String formatValueForAttribute(java.lang.Object obj, com.webobjects.eoaccess.EOAttribute eoattribute)
          Overridden in order to add milliseconds to the value.
 boolean mustUseBindVariableForAttribute(com.webobjects.eoaccess.EOAttribute attribute)
           
 void prepareConstraintStatementForRelationship(com.webobjects.eoaccess.EORelationship relationship, com.webobjects.foundation.NSArray sourceColumns, com.webobjects.foundation.NSArray destinationColumns)
           
static void setDelegate(EROracleExpression.Delegate delegate)
          Sets the delegate for this expression.
protected  boolean shouldAllowNull(com.webobjects.eoaccess.EOAttribute attribute)
           
 boolean shouldUseBindVariableForAttribute(com.webobjects.eoaccess.EOAttribute attribute)
           
 boolean useBindVariables()
           
 
Methods inherited from class com.webobjects.jdbcadaptor.OraclePlugIn.OracleExpression
assembleJoinClause, assembleUpdateStatementWithRow, sqlStringForKeyValueQualifier
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EROracleExpression

public EROracleExpression(com.webobjects.eoaccess.EOEntity eoentity)
Method Detail

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(com.webobjects.eoaccess.EOAttribute attribute)

addCreateClauseForAttribute

public void addCreateClauseForAttribute(com.webobjects.eoaccess.EOAttribute attribute)
Overrides:
addCreateClauseForAttribute in class com.webobjects.eoaccess.EOSQLExpression

bindVariableDictionaryForAttribute

public com.webobjects.foundation.NSMutableDictionary bindVariableDictionaryForAttribute(com.webobjects.eoaccess.EOAttribute eoattribute,
                                                                                        java.lang.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 com.webobjects.jdbcadaptor.JDBCExpression
Parameters:
obj -
eoattribute -
Returns:
the modified bindVariableDictionary

formatValueForAttribute

public java.lang.String formatValueForAttribute(java.lang.Object obj,
                                                com.webobjects.eoaccess.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 com.webobjects.jdbcadaptor.OraclePlugIn.OracleExpression
Parameters:
obj -
eoattribute -
Returns:
the modified string

useBindVariables

public boolean useBindVariables()
Overrides:
useBindVariables in class com.webobjects.jdbcadaptor.JDBCExpression
Returns:
true to indicate that the Oracle jdbc driver should use bind variables

shouldUseBindVariableForAttribute

public boolean shouldUseBindVariableForAttribute(com.webobjects.eoaccess.EOAttribute attribute)
Overrides:
shouldUseBindVariableForAttribute in class com.webobjects.jdbcadaptor.OraclePlugIn.OracleExpression
Returns:
true to indicate that the Oracle jdbc driver should use bind variables

mustUseBindVariableForAttribute

public boolean mustUseBindVariableForAttribute(com.webobjects.eoaccess.EOAttribute attribute)
Overrides:
mustUseBindVariableForAttribute in class com.webobjects.jdbcadaptor.OraclePlugIn.OracleExpression
Returns:
true to indicate that the Oracle jdbc driver should use bind variables

prepareConstraintStatementForRelationship

public void prepareConstraintStatementForRelationship(com.webobjects.eoaccess.EORelationship relationship,
                                                      com.webobjects.foundation.NSArray sourceColumns,
                                                      com.webobjects.foundation.NSArray destinationColumns)
Overrides:
prepareConstraintStatementForRelationship in class com.webobjects.jdbcadaptor.OraclePlugIn.OracleExpression

assembleSelectStatementWithAttributes

public java.lang.String assembleSelectStatementWithAttributes(com.webobjects.foundation.NSArray attributes,
                                                              boolean lock,
                                                              com.webobjects.eocontrol.EOQualifier qualifier,
                                                              com.webobjects.foundation.NSArray fetchOrder,
                                                              java.lang.String selectString,
                                                              java.lang.String columnList,
                                                              java.lang.String tableList,
                                                              java.lang.String whereClause,
                                                              java.lang.String joinClause,
                                                              java.lang.String orderByClause,
                                                              java.lang.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 com.webobjects.eoaccess.EOSQLExpression
Parameters:
attributes - the attributes to select
lock - flag for locking rows in the database
qualifier - the qualifier to restrict the selection
fetchOrder - specifies the fetch order
columnList - the SQL columns to be fetched
tableList - the the SQL tables to be fetched
whereClause - the SQL where clause
joinClause - the SQL join clause
orderByClause - the SQL sort order clause
lockClause - the SQL lock clause
Returns:
the select statement

addOrderByAttributeOrdering

public void addOrderByAttributeOrdering(com.webobjects.eocontrol.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 com.webobjects.eoaccess.EOSQLExpression
See Also:
EOSQLExpression.addOrderByAttributeOrdering(com.webobjects.eocontrol.EOSortOrdering)

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.