Package Modeling :: Package DatabaseAdaptors :: Package OracleAdaptorLayer :: Module OracleSQLExpression :: Class OracleSQLExpression
[show private | hide private]
[frames | no frames]

Type OracleSQLExpression

   object --+    
            |    
SQLExpression --+
                |
               OracleSQLExpression


Sub-class of SQLExpression for the OracleAdaptor. It overrides valueTypeForExternalTypeMapping() to add some new
Method Summary
  columnTypeStringForAttribute(self, attribute)
Overrides default implementation to handle TEXT field properly.
  sqlStringForCaseInsensitiveLike(self, keyString, valueString)
Overrides the default implementation and appends the string:
  sqlStringForKeyValueQualifier(self, aQualifier)
Overrides the default implementation and appends the string:
  valueTypeForExternalTypeMapping(self)
Adds the following SQL types to the set returned by Modeling.SQLExpression.valueTypeForExternalTypeMapping():
    Inherited from SQLExpression
  __init__(self, anEntity)
Initializer
  addBindVariableDictionary(self, binding)
  addCreateClauseForAttribute(self, attribute)
Adds the create clause for the supplied 'attribute' to the receiver's listString.
  addInsertListAttribute(self, attribute, value)
Parameters:
  addJoinClause(self, leftName, rightName, semantic)
  addOrderByAttributeOrdering(self, sortOrdering)
  addSelectListAttribute(self, attribute)
Adds the sqlStringForAttributeNamed(attribute.name()) to the SQLExpression's listString().
  addUpdateListAttribute(self, attribute, value)
Uses appendItemToListString() to add to listString() a string formatted that way:
  aliasesByRelationshipPath(self)
Returns the dictionary of table aliases used by the SQLExpression ; the keys are relationshipPath and the values are the corresponding table aliases.
  allowsNullClauseForConstraint(self, flag)
Returns 'NOT NULL' is flag is false, '' (empty string) otherwise.
  appendItemToListString(self, itemString, aStringIO)
Appends 'itemString' to 'aStringIO' ; if aStringIO is not empty, a comma is appended to aStringIO before 'itemString'
  assembleDeleteStatementWithQualifier(self, aQualifier, tableList, whereClause)
Generates the SQL DELETE statement and assigns it to self's statement() The generated statement has the following format:
  assembleInsertStatementWithRow(self, row, tableList, columnList, valueList)
Generates the SQL INSERT statement and assigns it to self's statement() The generated statement has the following format:
  assembleSelectStatementWithAttributes(self, attributes, lock, qualifier, fetchOrder, selectString, columnList, tableList, whereClause, joinClause, orderByClause, lockClause)
  assembleUpdateStatementWithRow(self, row, aQualifier, tableList, updateList, whereClause)
Generates the SQL INSERT statement and assigns it to self's statement() The generated statement has the following format:
  bindVariableDictionaries(self)
  bindVariableDictionaryForAttribute(self, attribute, value)
  entity(self)
Returns the Entity bound to that SQLExpression
  entityExternalNamesByAliases(self)
  externalNameQuoteCharacter(self)
Unimplemented
  formatSQLString(self, sqlString, format)
Unimplemented
  formatStringValue(self, string)
Unimplemented
  formatValueForAttribute(self, value, attribute)
Examines the attribute's externalType and forwards the request to the appropriate method.
  joinClauseString(self)
Unimplemented and unused: the joinClause is not used in this implementation of SQLExpression.
  joinExpression(self)
Unimplemented and not used: cf.
  listString(self)
Has a different meaning depending on what the SQLExpression was made for:
  lockClause(self)
  mustUseBindVariableForAttribute(self, attribute)
  orderByString(self)
  prepareConstraintStatementForRelationship(self, relationship, sourceColumns, destinationColumns)
  prepareDeleteExpressionForQualifier(self, aQualifier)
Prepares the internal state to generate a SQL delete statement, according to entity() and parameter 'aQualifier'.
  prepareInsertExpressionWithRow(self, row)
Generates an INSERT statement for the supplied 'row' and the SQLExpression's entity().
  prepareSelectCountExpressionWithAttributes(self, attributes, lock, fetchSpec)
Prepares a 'SELECT' statement from retrieving the number of rows corresponding to the request.
  prepareSelectExpressionWithAttributes(self, attributes, lock, fetchSpec)
Prepares a 'SELECT' statement.
  prepareUpdateExpressionWithRow(self, row, aQualifier)
Parameters:
  setStatement(self, statement)
Sets the object's SQL statement.
  setUseAliases(self, useAliases)
Tells the SQLExpression whether it should use table aliases.
  setUseBindVariables(self, flag)
Bind variables are not supported yet
  shouldUseBindVariableForAttribute(self, attribute)
Bind variables are not supported yet
  sqlEscapeChar(self)
  sqlPatternFromShellPattern(self, pattern)
Simply calls sqlPatternFromShellPatternWithEscapeCharacter() with 'escapeChar' equal to 'self.sqlEscapeChar()'
  sqlPatternFromShellPatternWithEscapeCharacter(self, pattern, escapeChar)
Transforms the shell 'pattern', using '*' and '?' as wildcards (the former matches 0 to many characters while the second matches one character) to an valid SQL pattern.
  sqlStringForAttribute(self, attribute)
Returns the attribute's columnName, prepended with the table alias for the empty string if the SQLExpression uses table aliases.
  sqlStringForAttributeNamed(self, name)
Returns the sql string for the attribute 'name'.
  sqlStringForAttributePath(self, path)
Given a path (see below), builds the corresponding sql string, completed with a table alias if the SQLExpression useAliases().
  sqlStringForConjoinedQualifiers(self, qualifiers)
Returns the SQL string, to be inserted in a WHERE clause, for the supplied ``to-be-conjoined'' qualifiers.
  sqlStringForData(self, data)
Not supported yet
  sqlStringForDate(self, aDate)
Formats the 'mxDateTime.DateTime' object 'aDate'.
  sqlStringForDisjoinedQualifiers(self, qualifiers)
Returns the SQL string, to be inserted in a WHERE clause, for the supplied ``to-be-disjoined'' qualifiers.
  sqlStringForInOperatorValue(self, aList, key)
Returns the SQL string suitable for operator IN and NOT IN.
  sqlStringForJoinSemantic(self, joinSemantic)
  sqlStringForKeyComparisonQualifier(self, aQualifier)
Returns the SQL string for the KeyComparisonQualifier supplied.
  sqlStringForNegatedQualifier(self, aQualifier)
Returns the SQL string for the supplied Qualifier
  sqlStringForNumber(self, aNumber, keyPath)
Formats 'aNumber' and returns the string suitable for inclusion in a SQL statement.
  sqlStringForQualifier(self, aQualifier)
Returns the SQL WHERE clause string built from 'aQualifier' ; NB: the generated statement does not include the 'WHERE' SQL keyword.
  sqlStringForSchemaObjectName(self, name)
Unimplemented
  sqlStringForSelector(self, selector, value)
Returns the appropriate SQL string corresponding to 'selector'
  sqlStringForString(self, aString)
Formats 'aString' and returns the string suitable for inclusion in a SQL statement.
  sqlStringForValue(self, value, keyPath)
Simply calls formatValueForAttribute() and return the formatted string
  statement(self)
Returns the statement assigned to this object.
  tableListWithRootEntity(self, anEntity)
  toString(self)
Simply returns self.statement()
  useAliases(self)
Returns whether the SQLExpression uses table aliases.
  useBindVariables(self)
Bind variables are not supported yet: return '0' (false)
  valueList(self)
This is set when prepareInsertExpressionWithRow() is called, and it holds the list of values to insert.
  valueTypeForExternalType(self, externalTypeName)
Returns the value type corresponding to 'externalTypeName'.
  whereClauseString(self)
Returns the WHERE clause string generated for a given SQL statement.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
int SQL92_join = 0                                                                     

Method Details

columnTypeStringForAttribute(self, attribute)

Overrides default implementation to handle TEXT field properly.

It returns a different string depending on some of the attribute's properties:

  • if attribute's precision is not zero: 'externalType(precision, scale)'
  • if attribute's width is not zero and its externalType is not TEXT: 'externalType(width)'
  • otherwise returns: 'externalType'

About 'TEXT': a model can define a width for a TEXT field. It should be ignored when generating the database schema (for example, TEXT(30) is an invalid data type), however it might be set to request the validation mechanism to check the attribute's length at runtime, typically before an EditingContext saves its changes.

See also:
addCreateClauseForAttribute() SchemaGeneration.createTableStatementsForEntityGroup()
Overrides:
Modeling.SQLExpression.SQLExpression.columnTypeStringForAttribute

sqlStringForCaseInsensitiveLike(self, keyString, valueString)

Overrides the default implementation and appends the string:

ESCAPE ''

to LIKE expression, so that Oracle can match as expected.

Overrides:
Modeling.SQLExpression.SQLExpression.sqlStringForCaseInsensitiveLike

sqlStringForKeyValueQualifier(self, aQualifier)

Overrides the default implementation and appends the string:

ESCAPE ''

to LIKE expression (and only to LIKE expressions), so that Oracle can match as expected.

Overrides:
Modeling.SQLExpression.SQLExpression.sqlStringForKeyValueQualifier

valueTypeForExternalTypeMapping(self)

Adds the following SQL types to the set returned by Modeling.SQLExpression.valueTypeForExternalTypeMapping():

  • character types: varchar2, nchar, nvarchar2
  • numeric types: number, decimal, smallint, real

and for Oracle9i only (see oracle_utils.oracle_server_version()):

  • date types: timestamp, timestamp with time zone,

    timestamp with local time zone

For Oracle8i 'timestamp' is removed from the valid data type.

Overrides:
Modeling.SQLExpression.SQLExpression.valueTypeForExternalTypeMapping

Class Variable Details

SQL92_join

Type:
int
Value:
0                                                                     

Generated by Epydoc 2.1 on Sat Mar 4 13:36:22 2006 http://epydoc.sf.net