Difference between revisions of "Statement"

From GreenVulcano Wiki
Jump to: navigation, search
({{GVESB}} Configuration)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Description==
 
==Description==
  
The [[Statement]] element contains the statement to be evaluated. Those statements might contain [[placeholders]] that will be replaced at runtime.
+
This element defines the statement to be evaluated.
  
It is used by: [[DBOperations]].
+
Can contains [[placeholders]] that will be replaced at runtime.
  
The following table shows its attributes:
+
=={{GVESB}} Configuration==
{|class="gvtable"
 
! Attribute !! Type !! Description
 
|-
 
| statementType || required || This element represents the type of statement to use.
 
We recommend using a CallableStatement to process stored procedures.
 
The attribute's admitted values are:
 
* CallableStatement
 
* PreparedStatement
 
|}
 
 
 
Might contain the sub-elements:
 
* [[#StatementValue|StatementValue]]
 
* [[#ParamResolvers|ParamResolvers]]
 
 
 
===StatementValue===
 
  
StatementValue contains the value of the statement to be performed.
+
The element statement can be used by:
 +
* [[CallDescriptor]]
 +
* [[DBOFlatSelect]]
 +
* [[DBOInsert]]
 +
* [[DBOInsertOrUpdate]]
 +
* [[DBOMultiFlatSelect]]
 +
* [[DBOSelect]]
 +
* [[DBOThreadSelect]]
 +
* [[DBOUpdate]]
 +
* [[DBOUpdateOrInsert]]
 +
* [[Excel-call#Sheet|Sheet]]
  
The StatementValue Element is used by: [[Statement]].
+
Its attributes are:
 
 
===ParamResolvers===
 
 
 
This element contains the list of Resolver used to resolve the parameters included in the statement.
 
 
 
Resolvers are applied in sequence, following the order of definition, and can be of different types.
 
 
 
The ParamResolvers Element is used by: [[Statement]].
 
 
 
Might contain more sub-elements:
 
* [[#ParamResolver|ParamResolver]]
 
 
 
====ParamResolver====
 
 
 
This element represents the type of a resolver to use for solving the parameters included in the statement.
 
 
 
The ParamResolver Element is used by: [[#ParamResolvers|ParamResolvers]]
 
 
 
Might contain the sub-elements:
 
* [[Description]]
 
* [[#XPathParamResolver|XPathParamResolver]] or [[#GVBufferParamResolver|GVBufferParamResolver]]
 
 
 
=====XPathParamResolver=====
 
 
 
Defines the type of Resolver based on XPath.
 
 
 
The XPathParamResolver Element is used by:  [[#ParamResolver|ParamResolver]].
 
The following table shows its attributes:
 
 
{|class="gvtable"
 
{|class="gvtable"
 
! Attribute !! Type !! Description
 
! Attribute !! Type !! Description
 
|-
 
|-
| type || fixed || This attribute must assume the value '''resolver'''.
+
| type || required || Must be:
|-
+
* DBOSelect : select
| class || fixed || This attribute must assume the value '''it.greenvulcano.gvesb.j2ee.db.resolver.XPathResolver'''.
+
* DBOInsert : insert
|}
+
* DBOUpdate : update
 
+
* DBOInsertOrUpdate : insert|update
Might contain the sub-elements:
+
* DBOUpdateOrInsert : insert|update
* [[Description]]
+
* DBOCallSP : callsp
* [[#Param|Param]]
+
* Excel Sheet : select
 
+
The attribute's admitted values are:
======Param======
+
* select
 
+
* insert
This element defines the parameter to be solved according to an XPath expression applied to the [[GVBuffer]] body.
+
* update
 
+
* callsp
The Param Element is used by: [[#XPathParamResolver|XPathParamResolver]].
 
 
 
The following table shows its attributes:
 
{|class="gvtable"
 
! Attribute !! Type !! Description
 
|-
 
| XPath || required || This attribute defines the XPath applied to the body of GVBuffer.
 
 
The attribute's value cannot be null.
 
The attribute's value cannot be null.
 
|-
 
|-
| position || required || This attribute defines the position parameter has in the statement.
+
| id || optional || Statement identifier. Default is 0. It is used as value of row/@id attribute:
 +
* Select: identifies the statement from which have been extracted the marked rows.
 +
* Update: identifies the statement to be used to process the input row parameters.
 
The attribute's value cannot be null.
 
The attribute's value cannot be null.
 
|-
 
|-
| type || required || This attribute defines the type of the parameter.
+
| keys || optional || Only useful in DBOSelect.
The attribute's admitted values are:
+
Specifies the index of select output on which group the results.
* string
+
The corresponding values are specified as attributes of 'data' element within the 'RowSet' element.
* int
+
For example, in the select: SELECT id,company_code,name FROM employees
* long
+
specifying the attribute keys = "2", the result would be:
* float
+
<syntaxhighlight lang="XML"><RowSet>
* date
+
  <data key_2="GreenVulcano">
* binary
+
      <row><col>19</col><col>pippo</col></row>
* blob
+
      <row><col>25</col><col>pluto</col></row>
* clob
+
  </data>
|-
+
</RowSet>
| format || optional || This attribute lets you configure the date format in the event that has been defined type = 'date'.
+
</syntaxhighlight>
The attribute's value cannot be null.
+
Can specify multiple keys separated by commas.
|}
 
 
 
Might contain the sub-elements:
 
* [[Description]]
 
 
 
  
=====GVBufferParamResolver=====
+
'''The select NEEDS to have an ORDER BY rule with THE SAME fields used in the attribute, and in the same order'''
  
This element defines the Resolver based GVBuffer fields.
 
 
The GVBufferParamResolver Element is used by: [[#ParamResolver|ParamResolver]].
 
 
The following table shows its attributes:
 
{|class="gvtable"
 
! Attribute !! Type !! Description
 
|-
 
| type || fixed || This attribute must assume the value '''resolver'''.
 
|-
 
| class || fixed || This attribute must assume the value '''it.greenvulcano.gvesb.j2ee.db.resolver.GVBufferResolver'''.
 
|}
 
 
Might contain the sub-elements:
 
* [[Description]]
 
* [[#GVBufferParam|GVBufferParam]]
 
 
======GVBufferParam======
 
 
This element represents the field of GVBuffer which is inserted in the statement.
 
 
The GVBufferParam Element is used by: [[#GVBufferParamResolver|GVBufferParamResolver]].
 
The following table shows its attributes:
 
{|class="gvtable"
 
! Attribute !! Type !! Description
 
|-
 
| type || required || This attribute defines the type of the parameter.
 
The attribute's admitted values are:
 
* string
 
* int
 
* long
 
* float
 
* date
 
* binary
 
* blob
 
* clob
 
|-
 
| position || required || This attribute defines the position parameter has in the statement.
 
The attribute's value cannot be null.
 
|-
 
| format || optional || This attribute lets you configure the date format in the event that has been defined type = 'date'.
 
 
The attribute's value cannot be null.
 
The attribute's value cannot be null.
|-
 
| GVBufferMethod || required || The attribute defines the GVBuffer method that solves the parameter.
 
The attribute's admitted values are:
 
* getSystem
 
* getService
 
* getId
 
* getRetCode
 
* getObject
 
* getProperty
 
|-
 
| propertyName || optional || This attribute defines the name of the property if the method is getProperty().
 
 
|}
 
|}
  
 
+
Does not contain subelements.
Might contain the sub-elements:
 
* [[Description]]
 

Latest revision as of 20:16, 6 April 2017

Description

This element defines the statement to be evaluated.

Can contains placeholders that will be replaced at runtime.

GreenVulcano® ESB Configuration

The element statement can be used by:

Its attributes are:

Attribute Type Description
type required Must be:
  • DBOSelect : select
  • DBOInsert : insert
  • DBOUpdate : update
  • DBOInsertOrUpdate : insert|update
  • DBOUpdateOrInsert : insert|update
  • DBOCallSP : callsp
  • Excel Sheet : select

The attribute's admitted values are:

  • select
  • insert
  • update
  • callsp

The attribute's value cannot be null.

id optional Statement identifier. Default is 0. It is used as value of row/@id attribute:
  • Select: identifies the statement from which have been extracted the marked rows.
  • Update: identifies the statement to be used to process the input row parameters.

The attribute's value cannot be null.

keys optional Only useful in DBOSelect.

Specifies the index of select output on which group the results. The corresponding values are specified as attributes of 'data' element within the 'RowSet' element. For example, in the select: SELECT id,company_code,name FROM employees specifying the attribute keys = "2", the result would be:

<RowSet>
   <data key_2="GreenVulcano">
      <row><col>19</col><col>pippo</col></row>
      <row><col>25</col><col>pluto</col></row>
   </data> 
</RowSet>

Can specify multiple keys separated by commas.

The select NEEDS to have an ORDER BY rule with THE SAME fields used in the attribute, and in the same order

The attribute's value cannot be null.

Does not contain subelements.