Qorus Integration Engine®  4.0.3.p2_git
OMQ::QorusSqlStatementOutboundMapper Class Reference

Qorus oubound mapper based on SqlUtil select. More...

Inheritance diagram for OMQ::QorusSqlStatementOutboundMapper:
TableMapper::SqlStatementOutboundMapper TableMapper::AbstractSqlStatementOutboundMapper Mapper::Mapper

Public Member Methods

private initOptions (reference opts)
 initializes the internal statement object
 
hash optionKeys ()
 returns a list of valid constructor options for this class (can be overridden in subclasses) More...
 

Static Public Member Methods

static SqlUtil::AbstractTable getTable (reference opts)
 called in the constructor to get the Table object
 
static *hash getSelectHash (reference opts)
 called in the constructor to get the SqlUtil select hash from options
 

Public Attributes

const OptionKeys
 valid mapper keys
 

Detailed Description

Qorus oubound mapper based on SqlUtil select.

Options used for QorusSqlStatementOutboundMapper are:

Example of the mapper definition in the qmapper file:

# name: regression-out-sql-statement
# version: 1.0
# desc: Regression test for QorusSqlStatementOutboundMapper
# type: QorusSqlStatementOutboundMapper
# author: Petr Vanek (Qore Technologies, s.r.o.)
OPTION: datasource: "omquser"
OPTION: table: "regression_example"
OPTION: sh : ( "columns" : ( "uuid" ),
"where" : ( "in_transit" : M_BIND,
"qorus_wfiid" : ( "^bind^" : "parent_wfiid"),
),
)
OPTION: output: (
)
FIELD: "uuid_mapped" : "uuid"
FIELD: "some_const" : ("constant" : "foobar")
# END

QorusSqlStatementOutboundMapper Variable Binding

When QorusSqlStatementOutboundMapper is initialized it can get the bind runtime option to make sh parametrized at runtime.

Example of mapper initialization in the workflow step:

hash ropts = ( "bind" : ( "in_transit" : 5, "parent_wfiid" : 1000 ) );
QorusSqlStatementOutboundMapper m = get_mapper("regression-out-sql-statement", ropts);

Then values provided in runtime options (ropts), key "bind" are passed to the mappers's select hash.

You can se use of the so called variable binding in the example above.

  • OMQ::M_BIND is a helper constant which says to the runtime that bound hash will contain the same key as the where condition hash key.
  • ( "^bind^" : string ) says that where condition hash key will be bounded by the value of string in the binding hash

Member Function Documentation

◆ optionKeys()

hash OMQ::QorusSqlStatementOutboundMapper::optionKeys ( )

returns a list of valid constructor options for this class (can be overridden in subclasses)

Returns
a list of valid constructor options for this class (can be overridden in subclasses)

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