![]() |
Qore TableMapper Module Reference 1.3
|
provides an outbound data mapper to a Table with SqlUtil select hash as a asource More...
Public Member Functions | |
| constructor (SqlUtil::AbstractTable source, *hash< auto > sh, hash< auto > mapv, *hash< auto > opts) | |
| builds the object based on an optional hash providing field mappings, data constraints, and optionally custom mapping logic | |
| constructor (SqlUtil::Table source, *hash< auto > sh, hash< auto > mapv, *hash< auto > opts) | |
| builds the object based on an optional hash providing field mappings, data constraints, and optionally custom mapping logic | |
| Qore::SQL::AbstractDatasource | getDatasource () |
| returns the AbstractDatasource object associated with this object | |
| SqlUtil::AbstractTable | getTable () |
| returns the underlying SqlUtil::AbstractTable object | |
| string | getTableName () |
| returns the table name | |
| hash< string, hash< MapperOptionInfo > > | getUserOptions () |
| returns mapper options useful for users | |
| initStatement () | |
| initializes the internal statement object | |
| hash< auto > | optionKeys () |
| returns a list of valid constructor options for this class (can be overridden in subclasses) | |
Public Member Functions inherited from TableMapper::AbstractSqlStatementOutboundMapper | |
| commit () | |
| commits the transaction and frees the Qore::SQL::AbstractDatasource transaction thread resource | |
| constructor (hash< auto > mapv, *hash< auto > opts) | |
| builds the object based on an optional hash providing field mappings, data constraints, and optionally custom mapping logic | |
| *hash< string, auto > | getData () |
| Retrieve mapped data as a hash of lists. | |
| *list< auto > | getDataRows () |
| Retrieve mapped data as a list of hashes. | |
| abstract Qore::SQL::AbstractDatasource | getDatasource () |
| returns the AbstractDatasource object associated with this object | |
| Qore::SQL::SQLStatement | getRowIterator () |
| returns a row iterator for the underlying SQL statement for this object | |
| Qore::SQL::AbstractSQLStatement | getStatement () |
| returns a row iterator for the underlying SQL statement for this object | |
| hash< string, hash< MapperOptionInfo > > | getUserOptions () |
| returns mapper options useful for users | |
| SqlStatementMapperIterator | iterator () |
| Returns an SqlStatementMapperIterator based on the current object. | |
| hash< auto > | optionKeys () |
| returns a list of valid constructor options for this class (can be overridden in subclasses) | |
| rollback () | |
| rolls the transaction back and frees the Qore::SQL::AbstractDatasource transaction thread resource | |
Protected Member Functions | |
| initOptions (reference< hash< auto > > opts) | |
| initializes options | |
Protected Member Functions inherited from TableMapper::AbstractSqlStatementOutboundMapper | |
| abstract | initOptions (reference< hash > opts) |
| re-implement to initialize options | |
| abstract | initStatement () |
| re-implement to initialize Qore::SQL::AbstractSQLStatement on demand | |
Protected Attributes | |
| const | OptionKeys = ... |
| option keys for this class | |
| const | UserOptions = ... |
| user options for this class | |
Protected Attributes inherited from TableMapper::AbstractSqlStatementOutboundMapper | |
Additional Inherited Members | |
Public Attributes inherited from TableMapper::AbstractSqlStatementOutboundMapper | |
| const | OptionDefaults = ... |
| default option values | |
| const | OptionKeys = ... |
| option keys for this class | |
Static Protected Member Functions inherited from TableMapper::AbstractSqlStatementOutboundMapper | |
| static *hash< string, AbstractDataField > | getInputRecordFromStmt (AbstractSQLStatement stmt, *hash< auto > input) |
| returns an input record description from an SQLStatement | |
provides an outbound data mapper to a Table with SqlUtil select hash as a asource
| TableMapper::SqlStatementOutboundMapper::constructor | ( | SqlUtil::AbstractTable | source, |
| *hash< auto > | sh, | ||
| hash< auto > | mapv, | ||
| *hash< auto > | opts ) |
builds the object based on an optional hash providing field mappings, data constraints, and optionally custom mapping logic
The source statement is also scanned using Qore::SQL::AbstractSQLStatement and column definitions are used to update the source record specification.
| source | the source table object. A sh select hash is applied to this table |
| sh | a SqlUtil select hash |
| mapv | a optional hash providing overrides for the default 1:1 input to output field mappings; each hash key is the name in lower case of the output column in the target table; each value is either True (meaning no translations are done; the data is copied 1:1) or a hash describing the mapping; see mapperkeys for detailed documentation for this option |
| opts | an optional hash of options for the mapper; see mapperoptions for a description of valid mapper options plus the following options specific to this object:
|
| MAP-ERROR |
| TableMapper::SqlStatementOutboundMapper::constructor | ( | SqlUtil::Table | source, |
| *hash< auto > | sh, | ||
| hash< auto > | mapv, | ||
| *hash< auto > | opts ) |
builds the object based on an optional hash providing field mappings, data constraints, and optionally custom mapping logic
The source statement is also scanned using Qore::SQL::SQLStatement and column definitions are used to update the source record specification.
| source | the source table object. A sh select hash is applied to this table |
| sh | a SqlUtil select hash |
| mapv | a optional hash providing overrides for the default 1:1 input to output field mappings; each hash key is the name in lower case of the output column in the target table; each value is either True (meaning no translations are done; the data is copied 1:1) or a hash describing the mapping; see mapperkeys for detailed documentation for this option |
| opts | an optional hash of options for the mapper; see mapperoptions for a description of valid mapper options plus the following options specific to this object:
|
| MAP-ERROR |
| SqlUtil::AbstractTable TableMapper::SqlStatementOutboundMapper::getTable | ( | ) |
returns the underlying SqlUtil::AbstractTable object
| string TableMapper::SqlStatementOutboundMapper::getTableName | ( | ) |
returns the table name
| hash< auto > TableMapper::SqlStatementOutboundMapper::optionKeys | ( | ) |
returns a list of valid constructor options for this class (can be overridden in subclasses)