public class JpaInboundChannelAdapterSpec extends MessageSourceSpec<JpaInboundChannelAdapterSpec,JpaPollingChannelAdapter> implements ComponentsRegistration
logger, PARSER, target
Modifier and Type | Method and Description |
---|---|
JpaInboundChannelAdapterSpec |
deleteAfterPoll(boolean deleteAfterPoll)
If set to 'true', the retrieved objects are deleted from the database upon
being polled.
|
JpaInboundChannelAdapterSpec |
deleteInBatch(boolean deleteInBatch)
If not set, this property defaults to
false , which means that
deletion occurs on a per object basis if a collection of entities is being
deleted. |
JpaInboundChannelAdapterSpec |
entityClass(java.lang.Class<?> entityClass)
Specify the class type which is being used for retrieving entities from the database.
|
JpaInboundChannelAdapterSpec |
expectSingleResult(boolean expectSingleResult)
This parameter indicates that only one result object shall be returned as
a result from the executed JPA operation.
|
JpaInboundChannelAdapterSpec |
flushAfterDelete(boolean flush)
If set to
true the EntityManager.flush() will be called
after persistence operation. |
java.util.Map<java.lang.Object,java.lang.String> |
getComponentsToRegister() |
JpaInboundChannelAdapterSpec |
jpaQuery(java.lang.String jpaQuery)
Specify a JPA query to perform persistent operation.
|
JpaInboundChannelAdapterSpec |
maxResults(int maxResults)
Set the maximum number of results expression.
|
JpaInboundChannelAdapterSpec |
maxResultsExpression(org.springframework.expression.Expression maxResultsExpression)
Specify a SpEL expression for maximum number of results expression.
|
JpaInboundChannelAdapterSpec |
maxResultsExpression(java.lang.String maxResultsExpression)
Specify a SpEL expression for maximum number of results expression.
|
JpaInboundChannelAdapterSpec |
namedQuery(java.lang.String namedQuery)
Specify a name a named JPQL based query or a native SQL query.
|
JpaInboundChannelAdapterSpec |
nativeQuery(java.lang.String nativeQuery)
Specify a native SQL query to perform persistent operation.
|
JpaInboundChannelAdapterSpec |
parameterSource(ParameterSource parameterSource)
Specify a
ParameterSource that would be used to provide additional parameters. |
messageHeaders
_this, afterPropertiesSet, destroy, doGet, get, getId, getObject, getObjectType, id
public JpaInboundChannelAdapterSpec entityClass(java.lang.Class<?> entityClass)
entityClass
- the entity Class
to usepublic JpaInboundChannelAdapterSpec jpaQuery(java.lang.String jpaQuery)
jpaQuery
- the JPA query to use.public JpaInboundChannelAdapterSpec nativeQuery(java.lang.String nativeQuery)
nativeQuery
- the native SQL query to use.public JpaInboundChannelAdapterSpec namedQuery(java.lang.String namedQuery)
namedQuery
- the name of the pre-configured query.public JpaInboundChannelAdapterSpec deleteAfterPoll(boolean deleteAfterPoll)
deleteAfterPoll
- Defaults to 'false'.public JpaInboundChannelAdapterSpec deleteInBatch(boolean deleteInBatch)
false
, 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 regards 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."
deleteInBatch
- Defaults to 'false' if not set.public JpaInboundChannelAdapterSpec flushAfterDelete(boolean flush)
true
the EntityManager.flush()
will be called
after persistence operation.
Has the same effect, if the flushSize
is specified to 1
.
For convenience in cases when the provided entity to persist is not an instance of Iterable
.flush
- defaults to 'false'.public JpaInboundChannelAdapterSpec parameterSource(ParameterSource parameterSource)
ParameterSource
that would be used to provide additional parameters.parameterSource
- the ParameterSource
to use.public JpaInboundChannelAdapterSpec expectSingleResult(boolean expectSingleResult)
true
and
the result list from the JPA operations contains only 1 element, then that
1 element is extracted and returned as payload.expectSingleResult
- true if a single object is expected.public JpaInboundChannelAdapterSpec maxResults(int maxResults)
maxResults
- the maximum number of results to retrievepublic JpaInboundChannelAdapterSpec maxResultsExpression(java.lang.String maxResultsExpression)
maxResultsExpression
- The maximum results expression.public JpaInboundChannelAdapterSpec maxResultsExpression(org.springframework.expression.Expression maxResultsExpression)
maxResultsExpression
- The maximum results expression.public java.util.Map<java.lang.Object,java.lang.String> getComponentsToRegister()
getComponentsToRegister
in interface ComponentsRegistration