Package com.adaptris.core.services.jdbc
Class FirstRowMetadataTranslator
- java.lang.Object
-
- com.adaptris.core.services.jdbc.ResultSetTranslatorBase
-
- com.adaptris.core.services.jdbc.StyledResultTranslatorImp
-
- com.adaptris.core.services.jdbc.ResultSetTranslatorImp
-
- com.adaptris.core.services.jdbc.MetadataResultSetTranslatorImpl
-
- com.adaptris.core.services.jdbc.FirstRowMetadataTranslator
-
- All Implemented Interfaces:
ComponentLifecycle
,ComponentLifecycleExtension
,ResultSetTranslator
public class FirstRowMetadataTranslator extends MetadataResultSetTranslatorImpl
Translate the first row 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()
and the column name (or label if it's different). The value is the value of the column.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-first-row-metadata-translator which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adaptris.core.services.jdbc.StyledResultTranslatorImp
StyledResultTranslatorImp.ColumnStyle
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.services.jdbc.MetadataResultSetTranslatorImpl
DEFAULT_METADATA_KEY
-
Fields inherited from class com.adaptris.core.services.jdbc.ResultSetTranslatorBase
log
-
-
Constructor Summary
Constructors Constructor Description FirstRowMetadataTranslator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
translateResult(JdbcResult source, AdaptrisMessage target)
Translate the result returning the number of rows translated.-
Methods inherited from class com.adaptris.core.services.jdbc.MetadataResultSetTranslatorImpl
getMetadataKeyPrefix, getResultSetCounterPrefix, getSeparator, setMetadataKeyPrefix, setResultSetCounterPrefix, setSeparator
-
Methods inherited from class com.adaptris.core.services.jdbc.ResultSetTranslatorImp
addColumnTranslator, getAttemptAutoConvert, getColumnTranslators, getDisplayColumnErrors, getResultCountMetadataItem, getUpdateCountMetadataItem, isDisplayColumnErrors, logColumnErrors, setAttemptAutoConvert, setColumnTranslators, setDisplayColumnErrors, setResultCountMetadataItem, setUpdateCountMetadataItem, toString, translate, updateMetadata, updateMetadataQueryCount, updateMetadataUpdateCount, withAttemptAutoConvert, withColumnTranslators, withColumnTranslators
-
Methods inherited from class com.adaptris.core.services.jdbc.StyledResultTranslatorImp
getColumnNameStyle, setColumnNameStyle, withColumnNameStyle
-
Methods inherited from class com.adaptris.core.services.jdbc.ResultSetTranslatorBase
prepare
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stop
-
-
-
-
Method Detail
-
translateResult
public long translateResult(JdbcResult source, AdaptrisMessage target) throws java.sql.SQLException, ServiceException
Description copied from class:ResultSetTranslatorImp
Translate the result returning the number of rows translated.- Specified by:
translateResult
in classResultSetTranslatorImp
- Throws:
java.sql.SQLException
ServiceException
-
-