|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.jpa.core.JpaExecutor
public class JpaExecutor
Executes Jpa Operations that produce payload objects from the result of the provided:
Message
payload.
Constructor Summary | |
---|---|
JpaExecutor(javax.persistence.EntityManager entityManager)
Constructor taking an EntityManager directly. |
|
JpaExecutor(javax.persistence.EntityManagerFactory entityManagerFactory)
Constructor taking an EntityManagerFactory from which the
EntityManager can be obtained. |
|
JpaExecutor(JpaOperations jpaOperations)
If custom behavior is required a custom implementation of JpaOperations
can be passed in. |
Method Summary | |
---|---|
void |
afterPropertiesSet()
Verifies and sets the parameters. |
protected java.util.List<?> |
doPoll(ParameterSource jpaQLParameterSource)
|
java.lang.Object |
executeOutboundJpaOperation(Message<?> message)
Executes the actual Jpa Operation. |
java.lang.Object |
poll()
Execute the JPA operation. |
java.lang.Object |
poll(Message<?> requestMessage)
Execute a (typically retrieving) JPA operation. |
void |
setDeleteAfterPoll(boolean deleteAfterPoll)
If set to 'true', the retrieved objects are deleted from the database upon being polled. |
void |
setDeletePerRow(boolean deletePerRow)
If not set, this property default to 'true', which means that deletion occur on a per object basis. |
void |
setEntityClass(java.lang.Class<?> entityClass)
Sets the class type which is being used to poll the database or to also update the persistence store. |
void |
setExpectSingleResult(boolean expectSingleResult)
|
void |
setJpaParameters(java.util.List<JpaParameter> jpaParameters)
|
void |
setJpaQuery(java.lang.String jpaQuery)
|
void |
setMaxRows(int maxNumberOfResults)
|
void |
setNamedQuery(java.lang.String namedQuery)
A named query can either refer to a named JPQL based query or a native SQL query. |
void |
setNativeQuery(java.lang.String nativeQuery)
You can also use native Sql queries to poll data from the database. |
void |
setParameterSource(ParameterSource parameterSource)
|
void |
setParameterSourceFactory(ParameterSourceFactory parameterSourceFactory)
|
void |
setPersistMode(PersistMode persistMode)
|
void |
setUsePayloadAsParameterSource(java.lang.Boolean usePayloadAsParameterSource)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JpaExecutor(javax.persistence.EntityManagerFactory entityManagerFactory)
EntityManagerFactory
from which the
EntityManager
can be obtained.
entityManagerFactory
- Must not be null.public JpaExecutor(javax.persistence.EntityManager entityManager)
EntityManager
directly.
entityManager
- Must not be null.public JpaExecutor(JpaOperations jpaOperations)
JpaOperations
can be passed in. The implementations themselves typically provide access
to the EntityManager
.
See also DefaultJpaOperations
and AbstractJpaOperations
.
jpaOperations
- Must not be null.Method Detail |
---|
public void afterPropertiesSet()
ParameterSourceFactory
.
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public java.lang.Object executeOutboundJpaOperation(Message<?> message)
message
-
public java.lang.Object poll(Message<?> requestMessage)
JpaExecutor#parameterSourceFactorymeterSourceFactory
. If the
requestMessage parameter is null then
parameterSource
is being used for providing query parameters.
requestMessage
- May be null.
public java.lang.Object poll()
poll(Message)
.
protected java.util.List<?> doPoll(ParameterSource jpaQLParameterSource)
public void setEntityClass(java.lang.Class<?> entityClass)
entityClass
- Must not be null.public void setJpaQuery(java.lang.String jpaQuery)
jpaQuery
- The provided JPA query must neither be null nor empty.public void setNativeQuery(java.lang.String nativeQuery)
nativeQuery
- The provided SQL query must neither be null nor empty.public void setNamedQuery(java.lang.String namedQuery)
namedQuery
- Must neither be null nor emptypublic void setPersistMode(PersistMode persistMode)
public void setJpaParameters(java.util.List<JpaParameter> jpaParameters)
public void setUsePayloadAsParameterSource(java.lang.Boolean usePayloadAsParameterSource)
public void setDeletePerRow(boolean deletePerRow)
deletePerRow
- Defaults to 'true'.public void setDeleteAfterPoll(boolean deleteAfterPoll)
deleteAfterPoll
- Defaults to 'false'.public void setMaxRows(int maxNumberOfResults)
maxNumberOfResults
- Must not be negative.public void setParameterSourceFactory(ParameterSourceFactory parameterSourceFactory)
parameterSourceFactory
- public void setParameterSource(ParameterSource parameterSource)
parameterSource
- public void setExpectSingleResult(boolean expectSingleResult)
|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |