Qore TableMapper Module Reference
1.3
|
provides a hash iterator based on a mapper object and an SQLStatement or SqlUtil select hash More...
Public Member Methods | |
constructor (TableMapper::AbstractSqlStatementOutboundMapper mapper) | |
creates the iterator from the Mapper passed More... | |
constructor (SqlUtil::AbstractTable table, hash sh, hash mapv, *hash opts) | |
creates the iterator from the arguments passed More... | |
constructor (SqlUtil::Table table, hash sh, hash mapv, *hash opts) | |
creates the iterator from the arguments passed More... | |
constructor (Qore::SQL::AbstractSQLStatement stmt, hash mapv, *hash opts) | |
creates the iterator from the arguments passed More... | |
int | getCount () |
returns the internal record count More... | |
auto | getRuntime (string key) |
get current runtime option value for a key More... | |
hash | getValue () |
returns the current row transformed with the mapper | |
bool | hasBulk () |
returns True because this class supports bulk mode | |
list | mapBulk (int size) |
performs bulk mapping by selecting the requested number of rows in a single select More... | |
replaceRuntime (*hash runtime) | |
replaces runtime options More... | |
resetCount () | |
resets the internal record count More... | |
setRuntime (string key, auto value) | |
set the runtime option with "key" to value "value" More... | |
setRuntime (hash runtime) | |
adds runtime options to the current runtime option hash More... | |
Private Attributes | |
Mapper::Mapper | m_mapper |
data mapper | |
provides a hash iterator based on a mapper object and an SQLStatement or SqlUtil select hash
provides support for bulk DML:
TableMapper::SqlStatementMapperIterator::constructor | ( | TableMapper::AbstractSqlStatementOutboundMapper | mapper | ) |
creates the iterator from the Mapper passed
mapper | the mapper to iterate |
TableMapper::SqlStatementMapperIterator::constructor | ( | SqlUtil::AbstractTable | table, |
hash | sh, | ||
hash | mapv, | ||
*hash | opts | ||
) |
creates the iterator from the arguments passed
table | SqlUtil::AbstractTable as a base for select hash sh |
sh | a SqlUtil select hash (columns/joins/wheres...) |
mapv | a hash providing field mappings; each hash key is the name of the output field; each value is either True (meaning no translations are done; the data is copied 1:1) or a hash describing the mapping; see Mapper Specification Format for detailed documentation for this option |
opts | an optional hash of options for the mapper; see Mapper Options for a description of valid mapper options |
MAP-ERROR | the map hash has a logical error (ex: "trunc" key given without "maxlen" , invalid map key) |
TableMapper::SqlStatementMapperIterator::constructor | ( | SqlUtil::Table | table, |
hash | sh, | ||
hash | mapv, | ||
*hash | opts | ||
) |
creates the iterator from the arguments passed
table | SqlUtil::Table as a base for select hash sh |
sh | a SqlUtil select hash (columns/joins/wheres...) |
mapv | a hash providing field mappings; each hash key is the name of the output field; each value is either True (meaning no translations are done; the data is copied 1:1) or a hash describing the mapping; see Mapper Specification Format for detailed documentation for this option |
opts | an optional hash of options for the mapper; see Mapper Options for a description of valid mapper options |
MAP-ERROR | the map hash has a logical error (ex: "trunc" key given without "maxlen" , invalid map key) |
TableMapper::SqlStatementMapperIterator::constructor | ( | Qore::SQL::AbstractSQLStatement | stmt, |
hash | mapv, | ||
*hash | opts | ||
) |
creates the iterator from the arguments passed
stmt | already constructed SQLStatement object |
mapv | the mapper to transform the data |
opts | an optional hash of options for the mapper; see Mapper Options for a description of valid mapper options |
int TableMapper::SqlStatementMapperIterator::getCount | ( | ) |
returns the internal record count
auto TableMapper::SqlStatementMapperIterator::getRuntime | ( | string | key | ) |
get current runtime option value for a key
key | the runtime option key |
performs bulk mapping by selecting the requested number of rows in a single select
size | the number of rows to return |
TableMapper::SqlStatementMapperIterator::replaceRuntime | ( | *hash | runtime | ) |
replaces runtime options
runtime | a hash of runtime options to use to replace the current runtime option hash |
TableMapper::SqlStatementMapperIterator::resetCount | ( | ) |
resets the internal record count
TableMapper::SqlStatementMapperIterator::setRuntime | ( | string | key, |
auto | value | ||
) |
set the runtime option with "key" to value "value"
key | a string with valid runtime key |
value | anything passed to the current runtime key |
TableMapper::SqlStatementMapperIterator::setRuntime | ( | hash | runtime | ) |
adds runtime options to the current runtime option hash
runtime | a hash of runtime options to add to the current runtime option hash |