Class JpaInboundChannelAdapterSpec
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<JpaInboundChannelAdapterSpec, JpaPollingChannelAdapter>
org.springframework.integration.dsl.MessageSourceSpec<JpaInboundChannelAdapterSpec, JpaPollingChannelAdapter>
org.springframework.integration.jpa.dsl.JpaInboundChannelAdapterSpec
- All Implemented Interfaces:
- DisposableBean,- FactoryBean<JpaPollingChannelAdapter>,- InitializingBean,- Lifecycle,- Phased,- SmartLifecycle,- ComponentsRegistration
public class JpaInboundChannelAdapterSpec
extends MessageSourceSpec<JpaInboundChannelAdapterSpec, JpaPollingChannelAdapter>
implements ComponentsRegistration
- Since:
- 5.0
- Author:
- Artem Bilan
- 
Field SummaryFieldsFields inherited from class org.springframework.integration.dsl.IntegrationComponentSpeclogger, PARSER, targetFields inherited from interface org.springframework.beans.factory.FactoryBeanOBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiondeleteAfterPoll(boolean deleteAfterPoll) If set to 'true', the retrieved objects are deleted from the database upon being polled.deleteInBatch(boolean deleteInBatch) If not set, this property defaults tofalse, which means that deletion occurs on a per-object basis if a collection of entities is being deleted.entityClass(Class<?> entityClass) Specify the class type which is being used for retrieving entities from the database.expectSingleResult(boolean expectSingleResult) This parameter indicates that only one result object shall be returned as a result from the executed JPA operation.flushAfterDelete(boolean flush) If set totruetheEntityManager.flush()will be called after persistence operation.Specify a JPA query to perform persistent operation.maxResults(int maxResults) Set the maximum number of results expression.maxResultsExpression(String maxResultsExpression) Specify a SpEL expression for maximum number of results expression.maxResultsExpression(Expression maxResultsExpression) Specify a SpEL expression for maximum number of results expression.namedQuery(String namedQuery) Specify a name a named JPQL based query or a native SQL query.nativeQuery(String nativeQuery) Specify a native SQL query to perform persistent operation.parameterSource(ParameterSource parameterSource) Specify aParameterSourcethat would be used to provide additional parameters.Methods inherited from class org.springframework.integration.dsl.MessageSourceSpecmessageHeadersMethods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec_this, afterPropertiesSet, destroy, doGet, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stopMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBeanisSingleton
- 
Field Details- 
jpaExecutor
 
- 
- 
Constructor Details- 
JpaInboundChannelAdapterSpec
 
- 
- 
Method Details- 
entityClassSpecify the class type which is being used for retrieving entities from the database.- Parameters:
- entityClass- the entity- Classto use
- Returns:
- the spec
 
- 
jpaQuerySpecify a JPA query to perform persistent operation.- Parameters:
- jpaQuery- the JPA query to use.
- Returns:
- the spec
 
- 
nativeQuerySpecify a native SQL query to perform persistent operation.- Parameters:
- nativeQuery- the native SQL query to use.
- Returns:
- the spec
 
- 
namedQuerySpecify a name a named JPQL based query or a native SQL query.- Parameters:
- namedQuery- the name of the pre-configured query.
- Returns:
- the spec
 
- 
deleteAfterPollIf set to 'true', the retrieved objects are deleted from the database upon being polled. May not work in all situations, e.g. for Native SQL Queries.- Parameters:
- deleteAfterPoll- Defaults to 'false'.
- Returns:
- the spec
 
- 
deleteInBatchIf not set, this property defaults tofalse, which means that deletion occurs on a per-object basis if a collection of entities is being deleted.If set to 'true' the elements of the payload are deleted as a batch operation. Be aware that this exhibits issues in regard to cascaded deletes. The specification 'JSR 317: Java Persistence API, Version 2.0' does not support cascaded deletes in batch operations. The specification states in chapter 4.10: "A delete operation only applies to entities of the specified class and its subclasses. It does not cascade to related entities." - Parameters:
- deleteInBatch- Defaults to 'false' if not set.
- Returns:
- the spec
 
- 
flushAfterDeleteIf set totruetheEntityManager.flush()will be called after persistence operation. Has the same effect, if theflushSizeis specified to1. For convenience in cases when the provided entity to persist is not an instance ofIterable.- Parameters:
- flush- defaults to 'false'.
- Returns:
- the spec
 
- 
parameterSourceSpecify aParameterSourcethat would be used to provide additional parameters.- Parameters:
- parameterSource- the- ParameterSourceto use.
- Returns:
- the spec
 
- 
expectSingleResultThis parameter indicates that only one result object shall be returned as a result from the executed JPA operation. If set totrueand the result list from the JPA operations contains only 1 element, then that 1 element is extracted and returned as payload.- Parameters:
- expectSingleResult- true if a single object is expected.
- Returns:
- the spec
 
- 
maxResultsSet the maximum number of results expression. It has to be a non-null value Not setting one will default to the behavior of fetching all the records- Parameters:
- maxResults- the maximum number of results to retrieve
- Returns:
- the spec
 
- 
maxResultsExpressionSpecify a SpEL expression for maximum number of results expression. Not setting one will default to the behavior of fetching all the records- Parameters:
- maxResultsExpression- The maximum results expression.
- Returns:
- the spec
 
- 
maxResultsExpressionSpecify a SpEL expression for maximum number of results expression. Not setting one will default to the behavior of fetching all the records- Parameters:
- maxResultsExpression- The maximum results expression.
- Returns:
- the spec
 
- 
getComponentsToRegister- Specified by:
- getComponentsToRegisterin interface- ComponentsRegistration
 
 
-