Class AllRowsMetadataTranslator

  • All Implemented Interfaces:
    ComponentLifecycle, ComponentLifecycleExtension, ResultSetTranslator

    public class AllRowsMetadataTranslator
    extends MetadataResultSetTranslatorImpl
    Translate the all the rows of the result set into metadata.

    Each column of the result set is used to create a new item of metadata. The metadata key for each new metadata item is the combination of {MetadataResultSetTranslatorImpl.getMetadataKeyPrefix(), MetadataResultSetTranslatorImpl.getSeparator(), the column name (or label if it's different) and a counter. The value is the value of the column. An additional note here; Some stored procedures can return multiple result sets, if this is the case then each metadata key will be prefixed with the result set counter, plus the MetadataResultSetTranslatorImpl.getResultSetCounterPrefix() If there is only 1 result set, no prefix will be applied for the result set count.

    The counter starts from 1

    If you want to see how many rows were processed you can set one/both of the following;

    Item Description Value
    result-count-metadata-itemIf set to a String metadata item name will specify the metadata item to contain the number of rows returned by your queryMetadata item name
    update-count-metadata-itemIf set to a String metadata item name will specify the metadata item to contain the number of rows updated by your SQL statementMetadata item name

    In the adapter configuration file this class is aliased as jdbc-all-rows-metadata-translator which is the preferred alternative to the fully qualified classname when building your configuration.