public class AllRowsMetadataTranslator extends MetadataResultSetTranslatorImpl
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-item | If set to a String metadata item name will specify the metadata item to contain the number of rows returned by your query | Metadata item name |
update-count-metadata-item | If set to a String metadata item name will specify the metadata item to contain the number of rows updated by your SQL statement | Metadata 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.
StyledResultTranslatorImp.ColumnStyle
DEFAULT_METADATA_KEY
log
Constructor and Description |
---|
AllRowsMetadataTranslator() |
Modifier and Type | Method and Description |
---|---|
long |
translateResult(JdbcResult source,
AdaptrisMessage target)
Translate the result returning the number of rows translated.
|
getMetadataKeyPrefix, getResultSetCounterPrefix, getSeparator, setMetadataKeyPrefix, setResultSetCounterPrefix, setSeparator
addColumnTranslator, getAttemptAutoConvert, getColumnTranslators, getDisplayColumnErrors, getResultCountMetadataItem, getUniqueId, getUpdateCountMetadataItem, isDisplayColumnErrors, logColumnErrors, setAttemptAutoConvert, setColumnTranslators, setDisplayColumnErrors, setResultCountMetadataItem, setUniqueId, setUpdateCountMetadataItem, toString, translate, updateMetadata, updateMetadataQueryCount, updateMetadataUpdateCount, withAttemptAutoConvert, withColumnTranslators, withColumnTranslators
getColumnNameStyle, setColumnNameStyle, withColumnNameStyle
public long translateResult(JdbcResult source, AdaptrisMessage target) throws java.sql.SQLException, ServiceException
ResultSetTranslatorImp
translateResult
in class ResultSetTranslatorImp
java.sql.SQLException
ServiceException