Package com.adaptris.interlok.jdbc
Class JDBCQueryStatementBuilder
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.jdbc.JdbcService
-
- com.adaptris.interlok.jdbc.JDBCStatementBuilder
-
- com.adaptris.interlok.jdbc.JDBCQueryStatementBuilder
-
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,ConnectedService,MessageEventGenerator,Service,StateManagedComponent
@ComponentProfile(summary="JDBC data query statement builder service", tag="jdbc,query,build,statement", since="4.1.0") public class JDBCQueryStatementBuilder extends JDBCStatementBuilderJDBC data query statement builder service.Build a JDBC data query service using the given statement to create the necessary parameter list. It turns:
<jdbc-statement-service> <unique-id>7b18517b-017d-4741-8b5e-9e490bff6c51</unique-id> <statement>SELECT * FROM person WHERE id = %sql_payload{string:id}</statement> </jdbc-statement-service>into:
<jdbc-data-query-service> <uniqueId>e99b6678-da08-4e25-810a-4d2cb59f0a44</uniqueId> <named-parameter-applicator> <parameterNamePrefix>#</parameterNamePrefix> <parameterNameRegex>#\w*</parameterNameRegex> </named-parameter-applicator> <statementParameters> <parameters> <jdbc-string-statement-parameter> <name>id</name> <queryString>id</queryString> <queryType>payload</queryType> <convertNull>false</convertNull> </jdbc-string-statement-parameter> </parameters> </statementParameters> <jdbc-configured-sql-statement> <statement>SELECT * FROM person WHERE id = #id</statement> </jdbc-configured-sql-statement> <jdbc-noop-result-set-translator/> </jdbc-data-query-service>
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description JDBCQueryStatementBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcloseJdbcService()Close the service.protected JdbcServiceWithParameterscreateService(java.lang.String statement)voiddoService(AdaptrisMessage message)Apply the service to the message.ResultSetTranslatorgetResultSetTranslator()protected voidinitJdbcService()voidsetResultSetTranslator(ResultSetTranslator resultSetTranslator)protected voidstartService()Start the service.protected voidstopService()Stop the service.-
Methods inherited from class com.adaptris.interlok.jdbc.JDBCStatementBuilder
buildService, getStatement, prepareService, setStatement
-
Methods inherited from class com.adaptris.core.jdbc.JdbcService
applyTimeout, closeService, createStatement, getConnection, getConnection, getStatementTimeout, initService, prepare, prepareStatement, prepareStatement, setConnection, setStatementTimeout, start, stop
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
-
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.AdaptrisComponent
getUniqueId
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
Methods inherited from interface com.adaptris.core.Service
continueOnFailure, isBranching, setUniqueId
-
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
-
-
-
Method Detail
-
createService
protected JdbcServiceWithParameters createService(java.lang.String statement)
- Specified by:
createServicein classJDBCStatementBuilder
-
initJdbcService
protected void initJdbcService() throws CoreException- Specified by:
initJdbcServicein classJdbcService- Throws:
CoreException
-
closeJdbcService
protected void closeJdbcService()
Close the service.This is called before the connection is closed
- Specified by:
closeJdbcServicein classJdbcService
-
startService
protected void startService() throws CoreExceptionStart the service.This is called after the connection is started
- Specified by:
startServicein classJdbcService- Throws:
CoreException
-
stopService
protected void stopService()
Stop the service.This is called after before the connection is stopped
- Specified by:
stopServicein classJdbcService
-
doService
public void doService(AdaptrisMessage message) throws ServiceException
Apply the service to the message.- Parameters:
message- theAdaptrisMessageto process.- Throws:
ServiceException- wrapping any underlyingException.
-
getResultSetTranslator
public ResultSetTranslator getResultSetTranslator()
-
setResultSetTranslator
public void setResultSetTranslator(ResultSetTranslator resultSetTranslator)
-
-