DataRetriever

From GreenVulcano Wiki
Revision as of 17:55, 23 February 2012 by G.dimaio (talk | contribs)
Jump to: navigation, search

The GreenVulcano® ESB element DataRetriever defines a helper function.

It is defined by four parameters:

Attribute Type Description
cacheable optional If true the calculated function value, for the given parameters set, is cached for future access during the service processing.
The cache is cancelled at service end.
Default false.
DataRetriever optional The helper function. Might contain placeholders.
method required Helper function name.
signature optional Comma-separated list of parameters name to be substituted in the function.


Examples of GenericRetriever services

<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 method="getPersonID" signature="NAME,CITY">
            select ID from PERSON
            where NAME='@{{NAME}}'
            and ID_CITY=(select ID from CITY where NAME='@{{CITY}}')
        </DataRetriever>

        <DataRetriever cacheable="true" method="getCardID" signature="NUMBER,ID_OWNER">
            select ID from CREDIT_CARD
            where CNUMBER='@{{NUMBER}}'
            and ID_OWNER=@{{ID_OWNER}}
        </DataRetriever>

        <DataRetriever method="getSeqVal">
            select SEQ_PERSON_ID.nextval from dual
        </DataRetriever>
    </GenericRetriever>
</RetrieverConfig>