Difference between revisions of "DBOUpdateOrInsert"

From GreenVulcano Wiki
Jump to: navigation, search
({{GVESB}} configuration)
({{GVESB}} configuration)
 
Line 11: Line 11:
  
 
Its attributes are:
 
Its attributes are:
 
+
{|class="gvtable"
* ''type'': dbo
+
! Attribute !! Type !! Description
* ''class'': it.greenvulcano.gvesb.datahandling.dbo.DBOUpdateOrInsert
+
|-
* ''name''
+
| type || fixed || This attribute must assume the value '''dbo'''
* ''transformation''
+
|-
* ''force-mode'' (caller|xml2db): Force mode of the DBO, can be used in [[DBOBuilder]] whit more heterogeneous DBO. <br/> Mode:<br/> caller - inherit the mode of the caller<br/> xml2db - data entry mode
+
| class || fixed || This attribute must assume the value '''it.greenvulcano.gvesb.datahandling.dbo.DBOUpdateOrInsert'''
* ''jdbc-connection-name'': DataSource JNDI name. <br/>  Override connection defined in [[DBOBuilder]].
+
|-
* ''ignore-input'' (true|false):  Tell the engine do not use the input data.
+
| name || required || DBOUpdateOrInsert name.
* ''input-data'': The default is the value of @name-Input.<br/>  Can be set as the @output-data of a preceding DBO to use its output as input.
+
|-
* ''output-data'': The default is the value of @name-Output.
+
| transformation || optional || Transformation to be applied on the input data to obtain the internal XML commands.
 +
|-
 +
| force-mode || optional || Force mode of the DBO, can be used in [[DBOBuilder]] whit more heterogeneous DBO. <br/> Mode:<br/> caller - inherit the mode of the caller<br/> xml2db - data entry mode
 +
The admitted values are:
 +
* caller
 +
* xml2db
 +
|-
 +
| jdbc-connection-name || required || DataSource JNDI name. <br/>  Override connection defined in [[DBOBuilder]].
 +
|-
 +
| ignore-input || required || Tell the engine do not use the input data.
 +
The attribute's admitted values are:
 +
* true
 +
* false
 +
|-
 +
| input-data || required || The default is the value of @name-Input.<br/>  Can be set as the @output-data of a preceding DBO to use its output as input.
 +
|-
 +
| output-data || required || The default is the value of @name-Output.
 +
|}
  
 
For example:
 
For example:

Latest revision as of 12:18, 12 November 2012

Description

The DBOUpdateOrInsert element runs the update, and if no record updated, the corresponding insert.

GreenVulcano® ESB configuration

DBOUpdateOrInsert with VulCon

DBOUpdateOrInsert might contain the following sub-elements:

Its attributes are:

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.DBOUpdateOrInsert
name required DBOUpdateOrInsert name.
transformation optional Transformation to be applied on the input data to obtain the internal XML commands.
force-mode optional Force mode of the DBO, can be used in DBOBuilder whit more heterogeneous DBO.
Mode:
caller - inherit the mode of the caller
xml2db - data entry mode

The admitted values are:

  • caller
  • xml2db
jdbc-connection-name required DataSource JNDI name.
Override connection defined in DBOBuilder.
ignore-input required Tell the engine do not use the input data.

The attribute's admitted values are:

  • true
  • false
input-data required 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 required The default is the value of @name-Output.

For example:

<?xml version="1.0" encoding="UTF-8"?>
 <DBOBuilder class="it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder" jdbc-connection-name="ds.gv_test" 
                    name="CreditUpdate"type="dbobuilder">
      <DHVariables>
          <DHVariable name="decimal-separator" value="."/>
          <DHVariable name="grouping-separator" value=","/>
          <DHVariable name="format" value="#0.00"/>
      </DHVariables>
      <DBOUpdateOrInsert class="it.greenvulcano.gvesb.datahandling.dbo.DBOUpdateOrInsert"
                    name="CreditUpdate"  transformation="CreditUpdate" type="dbo">
          <statement id="0" type="insert">insert into CREDIT_CARD (......) values (SEQ_PERSON_ID.nextval, ?, ?, ?, ?)</statement>
          <statement id="0" type="update">update CREDIT_CARD  set CREDIT=?, ENABLED=? where CNUMBER=? and ID_OWNER=?</statement>
      </DBOUpdateOrInsert>
 </DBOBuilder>