Class JdbcPipelineInput
java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.core.FoundationObject
com.northconcepts.datapipeline.foundations.pipeline.PipelineObject
com.northconcepts.datapipeline.foundations.pipeline.PipelineInput
com.northconcepts.datapipeline.foundations.pipeline.input.JdbcPipelineInput
- All Implemented Interfaces:
DataExceptionContributor,JsonSerializable,RecordSerializable,XmlSerializable,DataReaderFactory,JavaCodeGenerator,Serializable
Reads a pipeline's source data from a database query using a
JdbcReader.- See Also:
-
Field Summary
Fields inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
internalId, internalName, log, TIMESTAMP_FORMATFields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromRecord(Record source) Loads this instance's state from a record and returnsthis(for fluid API call chaining).fromXmlElement(Element pipelineInputElement) voidAppends Java source code representing this object to the given builder.getName()Returns a display name for this input, such as the source's name followed by its format.Object[]Returns the values bound, in order, to the query's?placeholders or null to run it as a plain statement.int[]Returns theTypescode of each parameter, in the same order, or null to bind them without a type.getQuery()Deprecated.booleanIndicates if the database connection is closed when the reader is closed (defaults to false).booleanIndicates if this input can save data lineage on the records it reads (false unless a subclass overrides it).booleanIndicates if column labels (aliases) are used as field names instead of the column names (defaults to false).setAutoCloseConnection(boolean autoCloseConnection) Indicates if the database connection is closed when the reader is closed (defaults to false).setJdbcConnectionFactory(JdbcConnectionFactory jdbcConnectionFactory) setJdbcConnectionFactory(Connection connection) Uses the given connection for every reader this input creates.setJdbcConnectionFactory(DataSource dataSource) Obtains a new connection from the data source for each reader this input creates.setParameters(Object[] parameters) Sets the values bound, in order, to the query's?placeholders or null to run it as a plain statement.setParameterSqlTypes(int[] parameterSqlTypes) Sets theTypescode of each parameter, in the same order, or null to bind them without a type.Deprecated.UsesetQueryString(String)instead.setQueryString(String queryString) setUseColumnLabel(boolean useColumnLabel) Indicates if column labels (aliases) are used as field names instead of the column names (defaults to false).toRecord()Converts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.toXmlElement(Document document) Returns an element, created withdocument, describing this object; the default implementation throws aDataException.Methods inherited from class com.northconcepts.datapipeline.foundations.pipeline.PipelineInput
getNestedPipelineInput, getPipelineInput, getRootPipelineInput, isSaveLineage, setSaveLineageMethods inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
addExceptionProperties, assertValid, assertValid, clone, exception, exception, exception, getInternalId, getInternalName, resetInternalIdMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.northconcepts.datapipeline.core.DataExceptionContributor
addExceptionProperties
-
Constructor Details
-
JdbcPipelineInput
public JdbcPipelineInput()
-
-
Method Details
-
getName
Description copied from class:PipelineInputReturns a display name for this input, such as the source's name followed by its format.- Specified by:
getNamein classPipelineInput
-
toRecord
Description copied from interface:RecordSerializableConverts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.- Specified by:
toRecordin interfaceRecordSerializable- Overrides:
toRecordin classPipelineInput
-
fromRecord
Description copied from interface:RecordSerializableLoads this instance's state from a record and returnsthis(for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.- Specified by:
fromRecordin interfaceRecordSerializable- Overrides:
fromRecordin classPipelineInput- Parameters:
source-- Returns:
- this instance.
-
getJdbcConnectionFactory
-
setJdbcConnectionFactory
-
setJdbcConnectionFactory
Uses the given connection for every reader this input creates. -
setJdbcConnectionFactory
Obtains a new connection from the data source for each reader this input creates. -
getQuery
Deprecated.UsegetQueryString()instead. -
getQueryString
-
setQuery
Deprecated.UsesetQueryString(String)instead. -
setQueryString
-
isAutoCloseConnection
public boolean isAutoCloseConnection()Indicates if the database connection is closed when the reader is closed (defaults to false). -
setAutoCloseConnection
Indicates if the database connection is closed when the reader is closed (defaults to false). -
isUseColumnLabel
public boolean isUseColumnLabel()Indicates if column labels (aliases) are used as field names instead of the column names (defaults to false). -
setUseColumnLabel
Indicates if column labels (aliases) are used as field names instead of the column names (defaults to false). -
getParameters
Returns the values bound, in order, to the query's?placeholders or null to run it as a plain statement. -
setParameters
Sets the values bound, in order, to the query's?placeholders or null to run it as a plain statement. -
getParameterSqlTypes
public int[] getParameterSqlTypes()Returns theTypescode of each parameter, in the same order, or null to bind them without a type. -
setParameterSqlTypes
Sets theTypescode of each parameter, in the same order, or null to bind them without a type. -
isLineageSupported
public boolean isLineageSupported()Description copied from class:PipelineInputIndicates if this input can save data lineage on the records it reads (false unless a subclass overrides it).- Overrides:
isLineageSupportedin classPipelineInput
-
createDataReader
-
generateJavaCode
Description copied from interface:JavaCodeGeneratorAppends Java source code representing this object to the given builder. -
toXmlElement
Description copied from interface:XmlSerializableReturns an element, created withdocument, describing this object; the default implementation throws aDataException.- Specified by:
toXmlElementin interfaceXmlSerializable- Overrides:
toXmlElementin classPipelineInput
-
fromXmlElement
- Specified by:
fromXmlElementin interfaceXmlSerializable- Overrides:
fromXmlElementin classPipelineInput
-
getQueryString()instead.