Arena  1.0
A content management system
 All Classes Files Functions Variables Pages
Library.DataSource.Queries.AQuery Class Reference

A basic query executed against a data source. More...

+ Inheritance diagram for Library.DataSource.Queries.AQuery:

Public Member Functions

def __init__
 Construct a new query instance that will operate on the specified data source. More...
 
def init
 Initializer.
 
def __del__
 Destroy the query instance. More...
 
def execute
 Execute the query. More...
 
def nextRecord
 Retrieve the next row from the query. More...
 
def recordCount
 Retrieve the number of rows affected or returned by the query. More...
 
def Rows
 Return an iterator for the query that retrieves rows as instances of the specified row class. More...
 
def __iter__
 Return an iterator for the query. More...
 
def __len__
 Retrieve the "length" of the query – the number of rows returned. More...
 
- Public Member Functions inherited from Library.DataSource.Databases.ADataOperation
def __init__
 Construct a new data operation that will operate on the specified data source. More...
 
def init
 Initializer.
 
def execute
 Execute the operation. More...
 
def Source
 Retrieve the data source used by the operation. More...
 
def handle
 Retrieve the handle assigned to the operation by the data source. More...
 
def runtime
 Retrieve the amount of time elapsed while executing the operation. More...
 
def result
 Retrieve the result code returned by the data source after executing the operation. More...
 
def message
 Retrieve the message generated by the data source while executing the operation, if any. More...
 
- Public Member Functions inherited from Library.Base.Events.ALoggingEventfulObject
def __init__
 Constructor. More...
 
def init
 Initializer.
 
def error
 Generate an error event. More...
 
def log
 Log the specified item. More...
 
def Log
 Retrieve the log used by the class.
 
- Public Member Functions inherited from Library.Base.Events.AnEventfulObject
def __init__
 Constructor. More...
 
def init
 Initializer.
 
def __del__
 Destructor.
 
def parseParams
 Parse the specified parameters, looking for named events and setting event handlers as appropriate. More...
 
def generate
 Generate the named event.
 
def update
 Update the events generated by the object.
 
def error
 Generate an error event. More...
 
def toString
 Construct a string representation of the object. More...
 
def on
 Set the handler for the specified event. More...
 
def onMultiple
 Set handlers for multiple events. More...
 
def handlerFor
 Retrieve the handler for the specified event. More...
 
def generates
 Determine whether or not the object generates the named event. More...
 
def __getitem__
 Retrieve the value of the named property.
 
def __setitem__
 Set the value of the named property.
 
- Public Member Functions inherited from Library.Base.Classwork.AnObject
def init
 Initialize a new object instance. More...
 
def __init__
 Construct and initialize a new instance of AnObject. More...
 
def __del__
 Destroy the object instance. More...
 
def displayName
 Construct a "pretty" display name for the class instance, based on the name of its class. More...
 
def implements
 Determine whether the class instance is related to the specified class. More...
 
def toString
 Return a string representation of the class, suitable for output to a console or text-based device. More...
 
def __str__
 Return a string representation of the class. More...
 
def classname
 Return the name of the class from which the instance was created. More...
 
def name
 Return the name of the class. More...
 
- Public Member Functions inherited from Library.String.Utilities.IsPrintable
def toString
 Return a string representation of the class conveniently. More...
 
def __str__
 Return a string representation of the class. More...
 
def printTo
 Print a string representation of the class to the specified stream. More...
 

Detailed Description

A basic query executed against a data source.

Note that this class does not implement the execute() method inherited from ADataOperation and so it should not be instantiated directly.

Constructor & Destructor Documentation

def Library.DataSource.Queries.AQuery.__init__ (   Self,
  params 
)

Construct a new query instance that will operate on the specified data source.

def Library.DataSource.Queries.AQuery.__del__ (   Self)

Destroy the query instance.

This routine should be implemented by descendant classes. It should free the query and release all associated resources.

Member Function Documentation

def Library.DataSource.Queries.AQuery.__iter__ (   Self)

Return an iterator for the query.

The iterator returned by this method returns instances of ADataRow. To return instances of another type of class instead, call AQuery.Rows() with the desired class.

This method allows the query to be treated as an iterable object within Python code (i.e., as part of a for..in statement).

def Library.DataSource.Queries.AQuery.__len__ (   Self)

Retrieve the "length" of the query – the number of rows returned.

def Library.DataSource.Queries.AQuery.execute (   Self)

Execute the query.

This routine should be implemented by descendant classes. It should construct the query string and submit it to the data source. An integer value should be returned to indicate whether execution was successful (but not necessarily whether the query returned any data). A return value of zero (0) indicates success.

def Library.DataSource.Queries.AQuery.nextRecord (   Self,
  RowClass = None,
  params 
)

Retrieve the next row from the query.

This routine should be implemented by descendant classes. It should return the next record from the data generated when the data operation was executed. This row should be returned as the specified instance of RowClass. If there are no more rows, then None should be returned.

If RowClass is specified, the routine should return an instance of that class. If no class is specified, an instance of ADataRow may be returned.

Any parameters passed in params will be fed to the row class constructor.

This method generates the nextRecord event.

def Library.DataSource.Queries.AQuery.recordCount (   Self)

Retrieve the number of rows affected or returned by the query.

def Library.DataSource.Queries.AQuery.Rows (   Self,
  RowClass = None,
  rowParams = None,
  params 
)

Return an iterator for the query that retrieves rows as instances of the specified row class.


The documentation for this class was generated from the following file: