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

Qorus oubound mapper based on raw SQL select statement. More...

Inheritance diagram for OMQ::QorusRawSqlStatementOutboundMapper:
[legend]
Collaboration diagram for OMQ::QorusRawSqlStatementOutboundMapper:
[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 Qore::SQL::AbstractDatasource getDatasource (reference< *hash< auto > > opts)
 called in the constructor to get the Table object
 

Public Attributes

const OptionKeys
 valid mapper keys
 
const UserOptions
 valid user options
 

Detailed Description

Qorus oubound mapper based on raw SQL select statement.

Options used for SqlRawStatementOutboundMapper are:

Example of the mapper definition in the qmapper file:

# name: regression-out-sql-statement
# version: 1.0
# desc: Regression test for QorusSqlStatementOutboundMapper
# type: QorusRawSqlStatementOutboundMapper
# author: Petr Vanek (Qore Technologies, s.r.o.)
OPTION: datasource: "omquser"
OPTION: select: "select * from my_table where id = %v"
OPTION: output: ()
FIELD: "uuid_mapped" : "uuid"
FIELD: "some_const" : ("constant" : "foobar")
# END

SqlRawStatementOutboundMapper Variable Binding

When SqlRawStatementOutboundMapper 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": 1};
SqlRawStatementOutboundMapper m = get_mapper("regression-out-sql-statement", ropts);

Then values provided in runtime options (ropts), key "bind" are passed to the mappers's select statement. Resulting in for example:

select * from my_table where id = :var_1;
-- binding 1 into :var_1

Member Function Documentation

◆ constructor()

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

constructs a mapper object

Parameters
mapva mapping hash
optsa option hash

◆ optionKeys()

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