Qorus Integration Engine® Enterprise Edition 6.0.16_prod
Loading...
Searching...
No Matches
OMQ::QorusSqlStatementOutboundMapper Class Reference

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

Inheritance diagram for OMQ::QorusSqlStatementOutboundMapper:
[legend]
Collaboration diagram for OMQ::QorusSqlStatementOutboundMapper:
[legend]

Public Member Methods

 constructor (hash< auto > mapv, *hash< auto > opts)
 constructs a mapper object More...
 
hash< auto > 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< *hash< auto > > opts)
 called in the constructor to get the Table object
 
static *hash< auto > getSelectHash (reference< *hash< auto > > opts)
 called in the constructor to get the SqlUtil select hash from options
 

Public Attributes

const OptionKeys
 valid mapper keys
 
const UserOptions
 valid user options
 

Private Member Methods

 initOptions (reference< *hash< auto > > opts)
 initializes the internal statement object
 

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<auto> ropts = {
"bind": {
"in_transit": 5,
"parent_wfiid": 1000,
},
};
QorusSqlStatementOutboundMapper m = getMapper("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 bound by the value of string in the binding hash

Member Function Documentation

◆ constructor()

OMQ::QorusSqlStatementOutboundMapper::constructor ( hash< auto >  mapv,
*hash< auto >  opts 
)

constructs a mapper object

Parameters
mapva mapping hash
optsa option hash

◆ optionKeys()

hash< auto > 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: