Interface JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
- All Superinterfaces:
org.apache.camel.builder.EndpointProducerBuilder,org.apache.camel.EndpointProducerResolver
- All Known Subinterfaces:
JpaEndpointBuilderFactory.JpaEndpointBuilder
- Enclosing interface:
- JpaEndpointBuilderFactory
public static interface JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
extends org.apache.camel.builder.EndpointProducerBuilder
Builder for endpoint producers for the JPA component.
-
Method Summary
Modifier and TypeMethodDescriptionadvanced()findEntity(boolean findEntity) If enabled then the producer will find a single entity by using the message body as key and entityType as the class type.findEntity(String findEntity) If enabled then the producer will find a single entity by using the message body as key and entityType as the class type.firstResult(int firstResult) Set the position of the first result to retrieve.firstResult(String firstResult) Set the position of the first result to retrieve.flushOnSend(boolean flushOnSend) Flushes the EntityManager after the entity bean has been persisted.flushOnSend(String flushOnSend) Flushes the EntityManager after the entity bean has been persisted.joinTransaction(boolean joinTransaction) The camel-jpa component will join transaction by default.joinTransaction(String joinTransaction) The camel-jpa component will join transaction by default.maximumResults(int maximumResults) Set the maximum number of results to retrieve on the Query.maximumResults(String maximumResults) Set the maximum number of results to retrieve on the Query.namedQuery(String namedQuery) To use a named query.nativeQuery(String nativeQuery) To use a custom native query.outputTarget(String outputTarget) To put the query (or find) result in a header or property instead of the body.persistenceUnit(String persistenceUnit) The JPA persistence unit used by default.To use a custom query.remove(boolean remove) Indicates to use entityManager.remove(entity).Indicates to use entityManager.remove(entity).resultClass(Class<Object> resultClass) Defines the type of the returned payload (we will call entityManager.createNativeQuery(nativeQuery, resultClass) instead of entityManager.createNativeQuery(nativeQuery)).resultClass(String resultClass) Defines the type of the returned payload (we will call entityManager.createNativeQuery(nativeQuery, resultClass) instead of entityManager.createNativeQuery(nativeQuery)).singleResult(boolean singleResult) If enabled, a query or a find which would return no results or more than one result, will throw an exception instead.singleResult(String singleResult) If enabled, a query or a find which would return no results or more than one result, will throw an exception instead.useExecuteUpdate(Boolean useExecuteUpdate) To configure whether to use executeUpdate() when producer executes a query.useExecuteUpdate(String useExecuteUpdate) To configure whether to use executeUpdate() when producer executes a query.usePersist(boolean usePersist) Indicates to use entityManager.persist(entity) instead of entityManager.merge(entity).usePersist(String usePersist) Indicates to use entityManager.persist(entity) instead of entityManager.merge(entity).Methods inherited from interface org.apache.camel.builder.EndpointProducerBuilder
doSetMultiValueProperties, doSetMultiValueProperty, doSetProperty, expr, getRawUri, getUriMethods inherited from interface org.apache.camel.EndpointProducerResolver
resolve, resolve
-
Method Details
-
advanced
-
joinTransaction
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder joinTransaction(boolean joinTransaction) The camel-jpa component will join transaction by default. You can use this option to turn this off, for example if you use LOCAL_RESOURCE and join transaction doesn't work with your JPA provider. This option can also be set globally on the JpaComponent, instead of having to set it on all endpoints. The option is a: <code>boolean</code> type. Default: true Group: common- Parameters:
joinTransaction- the value to set- Returns:
- the dsl builder
-
joinTransaction
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder joinTransaction(String joinTransaction) The camel-jpa component will join transaction by default. You can use this option to turn this off, for example if you use LOCAL_RESOURCE and join transaction doesn't work with your JPA provider. This option can also be set globally on the JpaComponent, instead of having to set it on all endpoints. The option will be converted to a <code>boolean</code> type. Default: true Group: common- Parameters:
joinTransaction- the value to set- Returns:
- the dsl builder
-
maximumResults
Set the maximum number of results to retrieve on the Query. The option is a: <code>int</code> type. Default: -1 Group: common- Parameters:
maximumResults- the value to set- Returns:
- the dsl builder
-
maximumResults
Set the maximum number of results to retrieve on the Query. The option will be converted to a <code>int</code> type. Default: -1 Group: common- Parameters:
maximumResults- the value to set- Returns:
- the dsl builder
-
namedQuery
To use a named query. The option is a: <code>java.lang.String</code> type. Group: common- Parameters:
namedQuery- the value to set- Returns:
- the dsl builder
-
nativeQuery
To use a custom native query. You may want to use the option resultClass also when using native queries. The option is a: <code>java.lang.String</code> type. Group: common- Parameters:
nativeQuery- the value to set- Returns:
- the dsl builder
-
persistenceUnit
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder persistenceUnit(String persistenceUnit) The JPA persistence unit used by default. The option is a: <code>java.lang.String</code> type. Required: true Default: camel Group: common- Parameters:
persistenceUnit- the value to set- Returns:
- the dsl builder
-
query
To use a custom query. The option is a: <code>java.lang.String</code> type. Group: common- Parameters:
query- the value to set- Returns:
- the dsl builder
-
resultClass
Defines the type of the returned payload (we will call entityManager.createNativeQuery(nativeQuery, resultClass) instead of entityManager.createNativeQuery(nativeQuery)). Without this option, we will return an object array. Only has an affect when using in conjunction with native query when consuming data. The option is a: <code>java.lang.Class<java.lang.Object></code> type. Group: common- Parameters:
resultClass- the value to set- Returns:
- the dsl builder
-
resultClass
Defines the type of the returned payload (we will call entityManager.createNativeQuery(nativeQuery, resultClass) instead of entityManager.createNativeQuery(nativeQuery)). Without this option, we will return an object array. Only has an affect when using in conjunction with native query when consuming data. The option will be converted to a <code>java.lang.Class<java.lang.Object></code> type. Group: common- Parameters:
resultClass- the value to set- Returns:
- the dsl builder
-
findEntity
If enabled then the producer will find a single entity by using the message body as key and entityType as the class type. This can be used instead of a query to find a single entity. The option is a: <code>boolean</code> type. Default: false Group: producer- Parameters:
findEntity- the value to set- Returns:
- the dsl builder
-
findEntity
If enabled then the producer will find a single entity by using the message body as key and entityType as the class type. This can be used instead of a query to find a single entity. The option will be converted to a <code>boolean</code> type. Default: false Group: producer- Parameters:
findEntity- the value to set- Returns:
- the dsl builder
-
firstResult
Set the position of the first result to retrieve. The option is a: <code>int</code> type. Default: -1 Group: producer- Parameters:
firstResult- the value to set- Returns:
- the dsl builder
-
firstResult
Set the position of the first result to retrieve. The option will be converted to a <code>int</code> type. Default: -1 Group: producer- Parameters:
firstResult- the value to set- Returns:
- the dsl builder
-
flushOnSend
Flushes the EntityManager after the entity bean has been persisted. The option is a: <code>boolean</code> type. Default: true Group: producer- Parameters:
flushOnSend- the value to set- Returns:
- the dsl builder
-
flushOnSend
Flushes the EntityManager after the entity bean has been persisted. The option will be converted to a <code>boolean</code> type. Default: true Group: producer- Parameters:
flushOnSend- the value to set- Returns:
- the dsl builder
-
outputTarget
To put the query (or find) result in a header or property instead of the body. If the value starts with the prefix property:, put the result into the so named property, otherwise into the header. The option is a: <code>java.lang.String</code> type. Group: producer- Parameters:
outputTarget- the value to set- Returns:
- the dsl builder
-
remove
Indicates to use entityManager.remove(entity). The option is a: <code>boolean</code> type. Default: false Group: producer- Parameters:
remove- the value to set- Returns:
- the dsl builder
-
remove
Indicates to use entityManager.remove(entity). The option will be converted to a <code>boolean</code> type. Default: false Group: producer- Parameters:
remove- the value to set- Returns:
- the dsl builder
-
singleResult
If enabled, a query or a find which would return no results or more than one result, will throw an exception instead. The option is a: <code>boolean</code> type. Default: false Group: producer- Parameters:
singleResult- the value to set- Returns:
- the dsl builder
-
singleResult
If enabled, a query or a find which would return no results or more than one result, will throw an exception instead. The option will be converted to a <code>boolean</code> type. Default: false Group: producer- Parameters:
singleResult- the value to set- Returns:
- the dsl builder
-
useExecuteUpdate
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder useExecuteUpdate(Boolean useExecuteUpdate) To configure whether to use executeUpdate() when producer executes a query. When you use INSERT, UPDATE or DELETE statement as a named query, you need to specify this option to 'true'. The option is a: <code>java.lang.Boolean</code> type. Group: producer- Parameters:
useExecuteUpdate- the value to set- Returns:
- the dsl builder
-
useExecuteUpdate
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder useExecuteUpdate(String useExecuteUpdate) To configure whether to use executeUpdate() when producer executes a query. When you use INSERT, UPDATE or DELETE statement as a named query, you need to specify this option to 'true'. The option will be converted to a <code>java.lang.Boolean</code> type. Group: producer- Parameters:
useExecuteUpdate- the value to set- Returns:
- the dsl builder
-
usePersist
Indicates to use entityManager.persist(entity) instead of entityManager.merge(entity). Note: entityManager.persist(entity) doesn't work for detached entities (where the EntityManager has to execute an UPDATE instead of an INSERT query)!. The option is a: <code>boolean</code> type. Default: false Group: producer- Parameters:
usePersist- the value to set- Returns:
- the dsl builder
-
usePersist
Indicates to use entityManager.persist(entity) instead of entityManager.merge(entity). Note: entityManager.persist(entity) doesn't work for detached entities (where the EntityManager has to execute an UPDATE instead of an INSERT query)!. The option will be converted to a <code>boolean</code> type. Default: false Group: producer- Parameters:
usePersist- the value to set- Returns:
- the dsl builder
-