|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.context.IntegrationObjectSupport org.springframework.integration.jdbc.StoredProcPollingChannelAdapter
public class StoredProcPollingChannelAdapter
A polling channel adapter that creates messages from the payload returned by executing a stored procedure or Sql function. Optionally an update can be executed after the execution of the Stored Procedure or Function in order to update processed rows.
Field Summary |
---|
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
StoredProcPollingChannelAdapter(javax.sql.DataSource dataSource,
java.lang.String storedProcedureName)
Deprecated. Since 2.2 use the constructor that expects a StoredProcExecutor instead |
|
StoredProcPollingChannelAdapter(StoredProcExecutor storedProcExecutor)
Constructor taking StoredProcExecutor . |
Method Summary | |
---|---|
protected java.util.Map<java.lang.String,?> |
doPoll()
|
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information. |
protected void |
onInit()
Subclasses may implement this for initialization logic. |
Message<java.lang.Object> |
receive()
Executes the query. |
void |
setExpectSingleResult(boolean expectSingleResult)
This parameter indicates that only one result object shall be returned from the Stored Procedure/Function Call. |
void |
setFunction(boolean isFunction)
Deprecated. Since 2.2 set the respective property on the passed-in StoredProcExecutor |
void |
setIgnoreColumnMetaData(boolean ignoreColumnMetaData)
Deprecated. Since 2.2 set the respective property on the passed-in StoredProcExecutor |
void |
setProcedureParameters(java.util.List<ProcedureParameter> procedureParameters)
Deprecated. Since 2.2 set the respective property on the passed-in StoredProcExecutor |
void |
setReturningResultSetRowMappers(java.util.Map<java.lang.String,org.springframework.jdbc.core.RowMapper<?>> returningResultSetRowMappers)
Deprecated. Since 2.2 set the respective property on the passed-in StoredProcExecutor |
void |
setReturnValueRequired(boolean returnValueRequired)
Deprecated. Since 2.2 set the respective property on the passed-in StoredProcExecutor |
void |
setSkipUndeclaredResults(boolean skipUndeclaredResults)
Deprecated. Since 2.2 set the respective property on the passed-in StoredProcExecutor |
void |
setSqlParameters(java.util.List<org.springframework.jdbc.core.SqlParameter> sqlParameters)
Deprecated. Since 2.2 set the respective property on the passed-in StoredProcExecutor |
void |
setSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory)
Deprecated. Since 2.2 set the respective property on the passed-in StoredProcExecutor |
void |
setStoredProcedureName(java.lang.String storedProcedureName)
Deprecated. Since 2.2 set the respective property on the passed-in StoredProcExecutor |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
@Deprecated public StoredProcPollingChannelAdapter(javax.sql.DataSource dataSource, java.lang.String storedProcedureName)
StoredProcExecutor
instead
DataSource
from which the DB Connection can be
obtained and the stored procedure name to execute.
dataSource
- used to create a SimpleJdbcCall
storedProcedureName
- Name of the Stored Procedure or Function to executepublic StoredProcPollingChannelAdapter(StoredProcExecutor storedProcExecutor)
StoredProcExecutor
.
storedProcExecutor
- Must not be null.Method Detail |
---|
protected void onInit() throws java.lang.Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
java.lang.Exception
public Message<java.lang.Object> receive()
null
.
receive
in interface MessageSource<java.lang.Object>
protected java.util.Map<java.lang.String,?> doPoll()
public java.lang.String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
@Deprecated public void setStoredProcedureName(java.lang.String storedProcedureName)
StoredProcExecutor
StoredProcExecutor.isFunction
is set to "true", then this
property specifies the Stored Function name.
Alternatively you can also specify the Stored Procedure name via
StoredProcExecutor.setStoredProcedureNameExpression(Expression)
.
storedProcedureName
- Must not be null and must not be emptyStoredProcExecutor.setStoredProcedureName(String)
@Deprecated public void setSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory)
StoredProcExecutor
SqlParameterSourceFactory
.
Keep in mind that if ProcedureParameter
are set explicitly and
you would like to provide a custom SqlParameterSourceFactory
,
then you must provide an instance of ExpressionEvaluatingSqlParameterSourceFactory
.
If not the SqlParameterSourceFactory will be replaced by the default
ExpressionEvaluatingSqlParameterSourceFactory
.
sqlParameterSourceFactory
- StoredProcExecutor.setSqlParameterSourceFactory(SqlParameterSourceFactory)
@Deprecated public void setSqlParameters(java.util.List<org.springframework.jdbc.core.SqlParameter> sqlParameters)
StoredProcExecutor
StoredProcExecutor.setSqlParameters(List)
@Deprecated public void setReturningResultSetRowMappers(java.util.Map<java.lang.String,org.springframework.jdbc.core.RowMapper<?>> returningResultSetRowMappers)
StoredProcExecutor
StoredProcExecutor.setReturningResultSetRowMappers(Map)
@Deprecated public void setIgnoreColumnMetaData(boolean ignoreColumnMetaData)
StoredProcExecutor
SqlParameter
explicitly..
ignoreColumnMetaData
- Defaults to false
.StoredProcExecutor.setIgnoreColumnMetaData(boolean)
@Deprecated public void setReturnValueRequired(boolean returnValueRequired)
StoredProcExecutor
returnValueRequired
- StoredProcExecutor.setReturnValueRequired(boolean)
@Deprecated public void setProcedureParameters(java.util.List<ProcedureParameter> procedureParameters)
StoredProcExecutor
Expression
.
StoredProcExecutor.setProcedureParameters(List)
@Deprecated public void setFunction(boolean isFunction)
StoredProcExecutor
isFunction
- If set to true an Sql Function is executed rather than a Stored Procedure.StoredProcExecutor.setIsFunction(boolean)
public void setExpectSingleResult(boolean expectSingleResult)
MessagingException
is thrown.
Otherwise the complete resultMap is returned as the Message
payload.
Important Note: Several databases such as H2 are not fully supported.
The H2 database, for example, does not fully support the CallableStatement
semantics and when executing function calls against H2, a result list is
returned rather than a single value.
Therefore, even if you set expectSingleResult = true, you may end up with
a collection being returned.
expectSingleResult
- @Deprecated public void setSkipUndeclaredResults(boolean skipUndeclaredResults)
StoredProcExecutor
true
then all results from a stored
procedure call that don't have a corresponding SqlOutParameter
declaration will be bypassed.
E.g. Stored Procedures may return an update count value, even though your
Stored Procedure only declared a single result parameter. The exact behavior
depends on the used database.
The value is set on the underlying JdbcTemplate
.
Only few developers will probably ever like to process update counts, thus
the value defaults to true
.
StoredProcExecutor.setSkipUndeclaredResults(boolean)
|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |