Difference between revisions of "DBOBuilder"

From GreenVulcano Wiki
Jump to: navigation, search
(Created page with "DBOBuilder: DataHandler service. It has the following attributes: * type: dbobuilder; * class: it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder; * name: Service name; *...")
 
 
(18 intermediate revisions by one other user not shown)
Line 1: Line 1:
DBOBuilder: DataHandler service.
+
==Description==
  
It has the following attributes:
+
[[File:DBOBuilder.jpg|thumb|DBOBuilder with VulCon]]The DBOBuilder element represents a [[DataHandler]] service.
  
* type: dbobuilder;
+
Might contain more [[#DBO|DBOs]] that represent all the elementary [[DataHandler]] operations that can be combined in a service.  
* class: it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder;
+
These [[#DBO|DBO]]s will be executed in order of definition. By default returns the output as a result of the last [[#DBO|DBO]].
* name: Service name;
+
The output of a [[#DBO|DBO]] can be used as input of the next.
* jdbc-connection-name: DataSource JNDI name;
 
* transacted (false|true): Defines if the services must be executed in transaction.  Default true.
 
* isXA (true|false): If the service is transacted, this attributes indicates if it participates in a distributed transaction or not. <br/> If ''false'' the DataHandler handle a local transaction. <br/> Default false;
 
* output-data: The default is the value of @output-data of the last DBOxxx;
 
* make-dump (none|text|hex): If set to ''none'' not perform the input/output data dump. <br/> If set to ''text'' or ''hex'' then the dump is performed as text or hexadecimal string. <br/> Default to ''text''.
 
  
 +
The statements used in the [[DBOBuilder#DBO|DBOs]] may contain metadata resolved at runtime that allows you to customize the actual command to be sent to the database.
  
For example:
+
The properties of the [[GVBuffer]] object can be referenced with the metadata <nowiki>@{{name}}</nowiki>.
 +
The body of the [[GVBuffer]] object, if any, is passed to the processing engine or data transformation engine, or it will be populated with the service output.
  
  <dh-call class="it.greenvulcano.gvesb.virtual.datahandler.DataHandlerCallOperation" name="TestInsertXML" type="call">
+
The following table shows the parameters included into the [[DBOBuilder]] output [[GVBuffer]] containing statistics about the operations done:
    <DBOBuilder class="it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder" jdbc-connection-name="" name="" type="dbobuilder">
+
{| class="gvtable"
            <DBOSelect class="it.greenvulcano.gvesb.datahandling.dbo.DBOSelect" name="" type="dbo">
+
! Parameter !! Description
                <statement type="select"/>
+
|-
            </DBOSelect>
+
| REC_TOTAL || number of founded records
    </DBOBuilder>
+
|-
  </dh-call>
+
| REC_READ || number of read records
 +
|-
 +
| REC_INSERT || number of inserted records
 +
|-
 +
| REC_UPDATE || number of updated records
 +
|-
 +
| REC_DISCARD || number of discarded records
 +
|-
 +
| REC_DISCARD_CAUSE || Report about discarded records
 +
|}
  
DBOBuilder accepts as children:
+
=={{GVESB}} configuration==
  
* Description;
+
The [[DBOBuilder]] element is used by [[dh-call]] and [[GVDataHandlerConfiguration]].
 +
 +
The following table shows its attributes:
 +
{|class="gvtable"
 +
! Attribute !! Type !! Description
 +
|-
 +
| type || fixed || This attribute must assume the value '''dbobuilder'''.
 +
|-
 +
| class || fixed || This attribute must assume the value '''it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder'''
 +
|-
 +
| name || required || Service name
 +
|-
 +
| jdbc-connection-name || required || DataSource JNDI name
 +
|-
 +
| transacted || optional || Defines if the services must be executed in transaction.  Default true.
 +
|-
 +
| isXA || optional || If the service is transacted, this attributes indicates if it participates in a distributed transaction or not. <br/> If ''false'' the DataHandler handle a local transaction. Default false
 +
|-
 +
| output-data || optional || The default is the value of @output-data of the last DBOxxx;
 +
|-
 +
| make-dump || optional || If set to ''none'' not perform the input/output data dump. <br/> If set to ''text'' or ''hex'' then the dump is performed as text or hexadecimal string. <br/> Default to ''text''.
 +
|}
  
* DHAliasList: List of aliases for a given DataHandler service. It contains
+
The following example shows who to configure [[DBOBuilder]] combined with the retrievers (see [[Retriever_Config|RetrieverConfig]]) and the use of metadata inside the statement:  
** DHAlias: Alias for a DataHandler service with its Description;
+
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
 +
<dh-call class="it.greenvulcano.gvesb.virtual.datahandler.DataHandlerCallOperation"
 +
        name="DataHandler" type="call">
 +
    <RetrieverConfig>
 +
      <GenericRetriever class="it.greenvulcano.gvesb.datahandling.utils.GenericRetriever" type="retriever">
 +
        <DataRetriever cacheable="true" method="getCityID" signature="NAME">
 +
              select ID from CITY where NAME='@{{NAME}}'
 +
        </DataRetriever>
 +
        <DataRetriever cacheable="true" method="getCityName" signature="ID">
 +
              select NAME from CITY where ID=@{{ID}}
 +
        </DataRetriever>
 +
        <DataRetriever>...
 +
        <DataRetriever>...
 +
        <DataRetriever>...
 +
      </GenericRetriever>
 +
    </RetrieverConfig>
 +
    <DBOBuilder class="it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder"
 +
                jdbc-connection-name="ds.gv_test" name="SearchPerson"
 +
                type="dbobuilder">
 +
      <DHVariables>
 +
          <DHVariable name="decimal-separator" value="."/>
 +
          <DHVariable name="grouping-separator" value=","/>
 +
          <DHVariable name="format" value="#0.00"/>
 +
          <DHVariable name="NAME" value="NULL"/>
 +
          <DHVariable name="CITY" value="NULL"/>
 +
      </DHVariables>
 +
      <DBOSelect class="it.greenvulcano.gvesb.datahandling.dbo.DBOSelect"
 +
                  name="SearchPerson" transformation="SearchPerson" type="dbo">
 +
          <statement id="1" keys="1,2,3" type="select">
 +
              select p.NAME, p.BIRTHDATE, c.NAME, cc.CNUMBER, cc.CREDIT, cc.ENABLED
 +
              from PERSON p, CITY c, CREDIT_CARD cc
 +
              where p.ID_CITY = c.ID
 +
              and p.ID = cc.ID_OWNER
 +
              decode{{@{{NAME}}::NULL::::and p.NAME like '%@{{NAME}}%'}}
 +
              decode{{@{{CITY}}::NULL::::and c.NAME like '%@{{CITY}}%'}}
 +
              order by c.NAME, p.NAME</statement>
 +
        </DBOSelect>
 +
  </DBOBuilder>
 +
  <DBOBuilder .../>
 +
  <DBOBuilder .../>
 +
</dh-call>
 +
</syntaxhighlight>
  
* DHVariables: List of default values for DataHandler service's variables. It contains
+
DBOBuilder has the following sub-element:
** DHVariable: Default value for DataHandler service's variable including the parameters
+
* [[Description]]
 +
 
 +
* DHAliasList: List of aliases for a given [[DataHandler]] service. It contains
 +
** DHAlias: Alias for a [[DataHandler]] service with its Description
 +
 
 +
* DHVariables: List of default values for [[DataHandler]] service's variables. It contains
 +
** DHVariable: Default value for [[DataHandler]] service's variable including the parameters
 
*** Description
 
*** Description
*** name: variable name
+
*** ''name'': variable name
*** value: variable value
+
*** ''value'': variable value
 +
 
 +
* [[#DBOs|DBOs]]
 +
<div class="version_ge3.4">
 +
* [[XMLMerge]]: replace the old Merge element
 +
</div>
 +
 
 +
====DBOs====
 +
 
 +
The DBO elements represent the elementary operations of [[DataHandler]] that can be combined in a service. Those are:
 +
 
 +
* [[DBOSelect]]
 +
* [[DBOThreadSelect]]
 +
* [[DBOUpdate]]
 +
* [[DBOInsert]]
 +
* [[DBOInsertOrUpdate]]
 +
* [[DBOUpdateOrInsert]]
 +
* [[DBOCallSP]]
 +
* [[DBOFlatSelect]]
 +
* [[DBOMultiFlatSelect]]
 +
 
 +
Inside of it you can include SQL statements which may contain metadata that will be resolved prior to execution.
  
* [[dbo_types]]: among these the DBOSelect as has been seen previously.
+
You can also add more DHVariable elements that define default values ​​for properties that may be missing in [[GVBuffer]].

Latest revision as of 13:07, 13 May 2014

Description

DBOBuilder with VulCon

The DBOBuilder element represents a DataHandler service.

Might contain more DBOs that represent all the elementary DataHandler operations that can be combined in a service. These DBOs will be executed in order of definition. By default returns the output as a result of the last DBO. The output of a DBO can be used as input of the next.

The statements used in the DBOs may contain metadata resolved at runtime that allows you to customize the actual command to be sent to the database.

The properties of the GVBuffer object can be referenced with the metadata @{{name}}. The body of the GVBuffer object, if any, is passed to the processing engine or data transformation engine, or it will be populated with the service output.

The following table shows the parameters included into the DBOBuilder output GVBuffer containing statistics about the operations done:

Parameter Description
REC_TOTAL number of founded records
REC_READ number of read records
REC_INSERT number of inserted records
REC_UPDATE number of updated records
REC_DISCARD number of discarded records
REC_DISCARD_CAUSE Report about discarded records

GreenVulcano® ESB configuration

The DBOBuilder element is used by dh-call and GVDataHandlerConfiguration.

The following table shows its attributes:

Attribute Type Description
type fixed This attribute must assume the value dbobuilder.
class fixed This attribute must assume the value it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder
name required Service name
jdbc-connection-name required DataSource JNDI name
transacted optional Defines if the services must be executed in transaction. Default true.
isXA optional If the service is transacted, this attributes indicates if it participates in a distributed transaction or not.
If false the DataHandler handle a local transaction. Default false
output-data optional The default is the value of @output-data of the last DBOxxx;
make-dump optional If set to none not perform the input/output data dump.
If set to text or hex then the dump is performed as text or hexadecimal string.
Default to text.

The following example shows who to configure DBOBuilder combined with the retrievers (see RetrieverConfig) and the use of metadata inside the statement:

<?xml version="1.0" encoding="UTF-8"?>
<dh-call class="it.greenvulcano.gvesb.virtual.datahandler.DataHandlerCallOperation"
         name="DataHandler" type="call">
    <RetrieverConfig>
       <GenericRetriever class="it.greenvulcano.gvesb.datahandling.utils.GenericRetriever" type="retriever">
         <DataRetriever cacheable="true" method="getCityID" signature="NAME">
              select ID from CITY where NAME='@{{NAME}}'
         </DataRetriever>
         <DataRetriever cacheable="true" method="getCityName" signature="ID">
              select NAME from CITY where ID=@{{ID}}
         </DataRetriever>
         <DataRetriever>...
         <DataRetriever>...
         <DataRetriever>...
       </GenericRetriever>
    </RetrieverConfig>
    <DBOBuilder class="it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder"
                jdbc-connection-name="ds.gv_test" name="SearchPerson"
                type="dbobuilder">
       <DHVariables>
          <DHVariable name="decimal-separator" value="."/>
          <DHVariable name="grouping-separator" value=","/>
          <DHVariable name="format" value="#0.00"/>
          <DHVariable name="NAME" value="NULL"/>
          <DHVariable name="CITY" value="NULL"/>
       </DHVariables>
       <DBOSelect class="it.greenvulcano.gvesb.datahandling.dbo.DBOSelect"
                  name="SearchPerson" transformation="SearchPerson" type="dbo">
          <statement id="1" keys="1,2,3" type="select">
              select p.NAME, p.BIRTHDATE, c.NAME, cc.CNUMBER, cc.CREDIT, cc.ENABLED
              from PERSON p, CITY c, CREDIT_CARD cc
              where p.ID_CITY = c.ID
              and p.ID = cc.ID_OWNER
              decode{{@{{NAME}}::NULL::::and p.NAME like '%@{{NAME}}%'}}
              decode{{@{{CITY}}::NULL::::and c.NAME like '%@{{CITY}}%'}}
              order by c.NAME, p.NAME</statement>
        </DBOSelect>
   </DBOBuilder>
   <DBOBuilder .../>
   <DBOBuilder .../>
</dh-call>

DBOBuilder has the following sub-element:

  • DHAliasList: List of aliases for a given DataHandler service. It contains
    • DHAlias: Alias for a DataHandler service with its Description
  • DHVariables: List of default values for DataHandler service's variables. It contains
    • DHVariable: Default value for DataHandler service's variable including the parameters
      • Description
      • name: variable name
      • value: variable value

DBOs

The DBO elements represent the elementary operations of DataHandler that can be combined in a service. Those are:

Inside of it you can include SQL statements which may contain metadata that will be resolved prior to execution.

You can also add more DHVariable elements that define default values ​​for properties that may be missing in GVBuffer.