If neither entityClass nor any other query is specified then the entity-class is "guessed" from the Message payload.
Constructor taking an EntityManager directly.
Constructor taking an EntityManagerFactory from which the EntityManager can be obtained.
If custom behavior is required a custom implementation of JpaOperations can be passed in.
Verify and sets the parameters.
Execute the actual Jpa Operation.
Execute a (typically retrieving) JPA operation.
If set to true the EntityManager.clear() will be called, and only if the EntityManager.flush() was called after performing persistence operations.
If set to 'true', the retrieved objects are deleted from the database upon being polled.
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.
Sets the class type which is being used for retrieving entities from the database.
This parameter indicates that only one result object shall be returned as a result from the executed JPA operation.
Set the expression that will be evaluated to get the first result in the query executed.
If set to true the EntityManager.flush() will be called after persistence operation.
If the provided value is greater than 0, then EntityManager.flush() will be called after persistence operations as well as within batch operations.
Set the max number of results to retrieve from the database.
Set the expression for maximum number of results expression.
A named query can either refer to a named JPQL based query or a native SQL query.
You can also use native Sql queries to poll data from the database.
Specify the ParameterSource that would be used to provide additional parameters.
entityManagerFactory - Must not be null.
entityManager - Must not be null.
If custom behavior is required a custom implementation of JpaOperations can be passed in. The implementations themselves typically provide access to the EntityManager. See also DefaultJpaOperations and AbstractJpaOperations.
jpaOperations - Must not be null.
Verify and sets the parameters. E.g. initializes the to be used ParameterSourceFactory.
Execute the actual Jpa Operation. Call this method, if you need access to process return values. This methods return a Map that contains either the number of affected entities or the affected entity itself.
Keep in mind that the number of entities effected by the operation may not necessarily correlate with the number of rows effected in the database.
Either the number of affected entities when using a JPQL query. When using a merge/persist the updated/inserted itself is returned.
Execute a (typically retrieving) JPA operation. The requestMessage can be used to provide additional query parameters using parameterSourceFactory. If the requestMessage parameter is null then parameterSource is being used for providing query parameters.
requestMessage - May be null.
The payload object, which may be null.
Execute the JPA operation. Delegates to poll(Message).
entityClass - Must not be null.
jpaQuery - The provided JPA query must neither be null nor empty.
You can also use native Sql queries to poll data from the database. If set this property will allow you to use native SQL. Optionally you can also set the entityClass property at the same time. If specified the entityClass will be used as the result class for the native query.
nativeQuery - The provided SQL query must neither be null nor empty.
If set to 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'.
If the provided value is greater than 0, then EntityManager.flush() will be called after persistence operations as well as within batch operations. This property has precedence over the flush, if it is specified to a value greater than 0. If the entity to persist is not an instance of Iterable and this property is greater than 0, then the entity will be flushed as if the flush attribute was set to true.
flushSize - defaults to '0'.
clearOnFlush - defaults to 'false'.
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.
deleteInBatch - Defaults to 'false' if not set.
If 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.
deleteAfterPoll - Defaults to 'false'.
parameterSource - Must not be null.
This parameter indicates that only one result object shall be returned as a result from the executed JPA operation. If set to true and the result list from the JPA operations contains only 1 element, then that 1 element is extracted and returned as payload.
If the result map contains more than 1 element and expectSingleResult is true, then a MessagingException is thrown.
If set to false, the complete result list is returned as the payload.
expectSingleResult - true if a single object is expected.
firstResultExpression - The first result expression.
idExpression - the SpEL expression for entity primaryKey.
maxResultsExpression - The maximum results expression.
Set the max number of results to retrieve from the database. Defaults to 0, which means that all possible objects shall be retrieved.
maxNumberOfResults - Must not be negative.