Difference between revisions of "DBOUpdate"

From GreenVulcano Wiki
Jump to: navigation, search
({{GVESB}} configuration)
Line 39: Line 39:
 
| output-data || optional || The default is the value of @name-Output.
 
| output-data || optional || The default is the value of @name-Output.
 
|}
 
|}
 +
<div class="version_ge3.4.0.6">
 +
{|class="gvtable"
 +
! Attribute !! Type !! Description
 +
|-
 +
| autogenerate-keys || optional || Tell the engine to handle auto generated keys at runtime (ex. autoincrement primary key fields). Default to false.
 +
|}
 +
</div>
  
 
For example:
 
For example:

Revision as of 13:48, 31 December 2014

Description

The DBOUpdate element represents the DBO optimized for update operations.

GreenVulcano® ESB configuration

DBOUpdate with VulCon

DBOUpdate allows you to update data into the database.

Each statement is identified by the id.

Actions can be defined in two ways:

  • Single execution of a statement
  • Complex execution guided by XML

In the first modality any input is ignored and the code executes the first statement configured.

In the second mode, the input XML (or its transformation) must contain the command (row) valid with all parameters (COL) required by the statement.

The following table shows the DBOUpdate attributes:

Attribute Type Description
type fixed This attribute must assume the value dbo
class fixed This attribute must assume the value it.greenvulcano.gvesb.datahandling.dbo.DBOUpdate
name required DBOUpdate name
transformation required Transformation to be applied on the input data to obtain the internal XML commands.
force-mode optional (caller or xml2db) Force mode of the DBO, can be used in DBOBuilder whit more heterogeneous DBOs.
Mode:
caller - inherit the mode of the caller
xml2db - data entry mode
jdbc-connection-name optional DataSource JNDI name.
Override connection defined in DBOBuilder.
ignore-input optional (true or false) Tells the engine do not use the input data.
input-data optional The default is the value of @name-Input.
Can be set as the @output-data of a preceding DBO to use its output as input.
output-data optional The default is the value of @name-Output.
Attribute Type Description
autogenerate-keys optional Tell the engine to handle auto generated keys at runtime (ex. autoincrement primary key fields). Default to false.

For example:

<?xml version="1.0" encoding="UTF-8"?>
 <DBOBuilder class="it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder"
              jdbc-connection-name="ds.gv_test" name="PersonInsertFull" type="dbobuilder">
       <DHVariables>
             <DHVariable name="decimal-separator" value="."/>
             <DHVariable name="grouping-separator" value=","/>
             <DHVariable name="format" value="#0.00"/>
       </DHVariables>
       <DBOUpdate class="it.greenvulcano.gvesb.datahandling.dbo.DBOUpdate"
               name="CCardPay" transformation="CCardPay" type="dbo">
               <statement id="0" type="update">
                        update CREDIT_CARD  set CREDIT= CREDIT - ?
                        where CNUMBER=?
                        and ENABLED=‘Y’
                        and CREDIT  >= ?
               </statement>
       </DBOUpdate>
 </DBOBuilder>

According with the data present into the database, this statement will return the following XML:

<RowSet>
    <data>
        <row>
            <col type="float">10</col>
            <col>1111222233334444</col>
            <col type="float">10</col>
       </row>
    </data>
</RowSet>

DBOUpdate might contain the following sub-elements: