Package Modeling :: Module AdaptorChannel :: Class AdaptorChannel
[show private | hide private]
[frames | no frames]

Class AdaptorChannel

Known Subclasses:
AbstractDBAPI2AdaptorChannel

See interfaces.AdaptorChannel for details
Method Summary
  __init__(self, anAdaptorContext)
See interfaces.AdaptorChannel for details
  __unimplemented__(self)
  adaptorContext(self)
See interfaces.AdaptorChannel for details
  addStoredProceduresNamed(self, storedProcedureNames, aModel)
See interfaces.AdaptorChannel for details
  attributesToFetch(self)
See interfaces.AdaptorChannel for details
  cancelFetch(self)
See interfaces.AdaptorChannel for details
  closeChannel(self)
See interfaces.AdaptorChannel for details
  delegate(self)
See interfaces.AdaptorChannel for details
  deleteRowDescribedByQualifier(self, aQualifier, anEntity)
Calls 'deleteRowsDescribedByQualifier()' on itself and make sure that one and only one row was deleted.
  deleteRowsDescribedByQualifier(self, aQualifier, anEntity)
Implemented by subclasses to delete the rows identified by the parameters.
  describeModelWithTableNames(self, tableNames)
See interfaces.AdaptorChannel for details
  describeResults(self)
See interfaces.AdaptorChannel for details
  describeStoredProcedureNames(self)
See interfaces.AdaptorChannel for details
  describeTableNames(self)
See interfaces.AdaptorChannel for details
  dictionaryWithObjectsForAttributes(self, objects, attributes)
See interfaces.AdaptorChannel for details
  evaluateExpression(self, anSQLexpression)
Extract the SQL statement from 'anSQLexpression' and sends it to the database for execution.
  executeStoredProcedure(self, aStoredProcedure, values)
See interfaces.AdaptorChannel for details
  fetchRow(self)
See interfaces.AdaptorChannel for details
  insertRow(self, row, anEntity)
See interfaces.AdaptorChannel for details
  isFetchInProgress(self)
See interfaces.AdaptorChannel for details
  isOpen(self)
See interfaces.AdaptorChannel for details
  lockRowComparingAttributes(self, atts, anEntity, aQualifier, snapshot)
See interfaces.AdaptorChannel for details
  openChannel(self)
See interfaces.AdaptorChannel for details
  performAdaptorOperation(self, anAdaptorOperation)
Examines 'anAdaptorOperation' and executes the corresponding method.
  performAdaptorOperations(self, adaptorOperations)
Iterates on each item in 'adaptorOperations' and calls 'performAdaptorOperation()' with that item as a parameter.
  primaryKeysForNewRowsWithEntity(self, count, anEntity)
See interfaces.AdaptorChannel for details
  returnValuesForLastStoredProcedureInvocation(self)
See interfaces.AdaptorChannel for details
  rowCountForSelectAttributes(self, attributes, aFetchSpecification, shouldLock, anEntity)
Implemented by concrete adaptors to return the number of rows that would be fetched if selectAttributes() is called with the same arguments.
  selectAttributes(self, attributes, aFetchSpecification, shouldLock, anEntity)
See interfaces.AdaptorChannel for details
  setAttributesToFetch(self, attributes)
See interfaces.AdaptorChannel for details
  setDelegate(self, aDelegate)
See interfaces.AdaptorChannel for details
  updateValuesInRowDescribedByQualifier(self, row, aQualifier, anEntity)
Calls 'updateValuesInRowsDescribedByQualifier' on itself and make sure that one and only one row was updated.
  updateValuesInRowsDescribedByQualifier(self, row, aQualifier, anEntity)
Implemented by subclasses to update the rows identified by the parameters.

Class Variable Summary
tuple __implements__ = (<class Modeling.interfaces.AdaptorChan...

Method Details

__init__(self, anAdaptorContext)
(Constructor)

See interfaces.AdaptorChannel for details

__unimplemented__(self)

adaptorContext(self)

See interfaces.AdaptorChannel for details

addStoredProceduresNamed(self, storedProcedureNames, aModel)

See interfaces.AdaptorChannel for details

attributesToFetch(self)

See interfaces.AdaptorChannel for details

cancelFetch(self)

See interfaces.AdaptorChannel for details

closeChannel(self)

See interfaces.AdaptorChannel for details

delegate(self)

See interfaces.AdaptorChannel for details

deleteRowDescribedByQualifier(self, aQualifier, anEntity)

Calls 'deleteRowsDescribedByQualifier()' on itself and make sure that one and only one row was deleted. If the returned value from 'deleteRowsDescribedByQualifier()' is not one, it raises GeneralAdaptorException.

Subclasses should not override this method.

Parameters: see deleteRowsDescribedByQualifier()

deleteRowsDescribedByQualifier(self, aQualifier, anEntity)

Implemented by subclasses to delete the rows identified by the parameters.

This method returns the number of rows deleted.

Parameters:

aQualifier -- a Qualifier object describing the rows to delete

anEntity -- the Entity corresponding to the type of the objects
to-be-deleted (hence, identifies the database table from which rows should be deleted)

See also: deleteRowDescribedByQualifier(), performAdaptorOperation()

describeModelWithTableNames(self, tableNames)

See interfaces.AdaptorChannel for details

describeResults(self)

See interfaces.AdaptorChannel for details

describeStoredProcedureNames(self)

See interfaces.AdaptorChannel for details

describeTableNames(self)

See interfaces.AdaptorChannel for details

dictionaryWithObjectsForAttributes(self, objects, attributes)

See interfaces.AdaptorChannel for details

evaluateExpression(self, anSQLexpression)

Extract the SQL statement from 'anSQLexpression' and sends it to the database for execution.

If its AdaptorContext did not have an opened transaction when this method is called, it should automatically start a new transaction which is ended before the method returns.

Parameter:

anSQLexpression -- the SQLExpression object to execute

See also: SQLExpression.statement(), AdaptorContext.hasOpenTransaction()

executeStoredProcedure(self, aStoredProcedure, values)

See interfaces.AdaptorChannel for details

fetchRow(self)

See interfaces.AdaptorChannel for details

insertRow(self, row, anEntity)

See interfaces.AdaptorChannel for details

isFetchInProgress(self)

See interfaces.AdaptorChannel for details

isOpen(self)

See interfaces.AdaptorChannel for details

lockRowComparingAttributes(self, atts, anEntity, aQualifier, snapshot)

See interfaces.AdaptorChannel for details

openChannel(self)

See interfaces.AdaptorChannel for details

performAdaptorOperation(self, anAdaptorOperation)

Examines 'anAdaptorOperation' and executes the corresponding method.

Given that 'operator' is anAdaptorOperation.operator(), and that constants used below (such as 'ADAPTOR_INSERT_OPERATOR') are defined in class DatabaseOperation, this is how things work:

  • if 'operator' is 'ADAPTOR_INSERT_OPERATOR', we call insertRow()
  • if 'operator' is 'ADAPTOR_DELETE_OPERATOR', we call deleteRowDescribedByQualifier()
  • 'operator' is 'ADAPTOR_UPDATE_OPERATOR', we call updateValuesInRowDescribedByQualifier()

Subclasses should not override this method.

Raises GeneralAdaptorException in case of failure

Parameter:

adaptorOperation -- the AdaptorOperation to execute

See also: performAdaptorOperations(), DatabaseOperation

performAdaptorOperations(self, adaptorOperations)

Iterates on each item in 'adaptorOperations' and calls 'performAdaptorOperation()' with that item as a parameter.

Subclasses should not override this method.

Parameter:

adaptorOperations -- a sequence of AdaptorOperation objects

primaryKeysForNewRowsWithEntity(self, count, anEntity)

See interfaces.AdaptorChannel for details

returnValuesForLastStoredProcedureInvocation(self)

See interfaces.AdaptorChannel for details

rowCountForSelectAttributes(self, attributes, aFetchSpecification, shouldLock, anEntity)

Implemented by concrete adaptors to return the number of rows that would be fetched if selectAttributes() is called with the same arguments.

Parameters: see selectAttributes()

See also: SQLExpression.prepareSelectCountExpressionWithAttributes()

selectAttributes(self, attributes, aFetchSpecification, shouldLock, anEntity)

See interfaces.AdaptorChannel for details

setAttributesToFetch(self, attributes)

See interfaces.AdaptorChannel for details

setDelegate(self, aDelegate)

See interfaces.AdaptorChannel for details

updateValuesInRowDescribedByQualifier(self, row, aQualifier, anEntity)

Calls 'updateValuesInRowsDescribedByQualifier' on itself and make sure that one and only one row was updated. If the returned value from 'updateValuesInRowsDescribedByQualifier' is not exactly one, it raises GeneralAdaptorException.

Subclasses should not override this method.

Parameters: see updateValuesInRowsDescribedByQualifier

updateValuesInRowsDescribedByQualifier(self, row, aQualifier, anEntity)

Implemented by subclasses to update the rows identified by the parameters.

This method returns the number of updated rows.

Parameters:

row --

aQualifier -- a Qualifier object describing the rows to update

anEntity -- the Entity corresponding to the type of the objects to be
updated (hence, identifies the database table from which rows should be updated)
See also: updateValuesInRowDescribedByQualifier(),
performAdaptorOperation()

Returns: the number of updated rows


Class Variable Details

__implements__

Type:
tuple
Value:
(<class Modeling.interfaces.AdaptorChannel.IAdaptorChannel at 0xb77020\
8c>,)                                                                  

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