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
All Methods Instance Methods Default Methods Modifier and Type Method Description default JpaEndpointBuilderFactory.AdvancedJpaEndpointProducerBuilder
advanced()
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
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.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
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.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
firstResult(int firstResult)
Set the position of the first result to retrieve.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
firstResult(String firstResult)
Set the position of the first result to retrieve.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
flushOnSend(boolean flushOnSend)
Flushes the EntityManager after the entity bean has been persisted.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
flushOnSend(String flushOnSend)
Flushes the EntityManager after the entity bean has been persisted.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
joinTransaction(boolean joinTransaction)
The camel-jpa component will join transaction by default.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
joinTransaction(String joinTransaction)
The camel-jpa component will join transaction by default.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
maximumResults(int maximumResults)
Set the maximum number of results to retrieve on the Query.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
maximumResults(String maximumResults)
Set the maximum number of results to retrieve on the Query.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
namedQuery(String namedQuery)
To use a named query.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
nativeQuery(String nativeQuery)
To use a custom native query.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
outputTarget(String outputTarget)
To put the query (or find) result in a header or property instead of the body.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
persistenceUnit(String persistenceUnit)
The JPA persistence unit used by default.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
query(String query)
To use a custom query.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
remove(boolean remove)
Indicates to use entityManager.remove(entity).default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
remove(String remove)
Indicates to use entityManager.remove(entity).default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
resultClass(Class<Object> resultClass)
Defines the type of the returned payload (we will call entityManager.createNativeQuery(nativeQuery, resultClass) instead of entityManager.createNativeQuery(nativeQuery)).default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
resultClass(String resultClass)
Defines the type of the returned payload (we will call entityManager.createNativeQuery(nativeQuery, resultClass) instead of entityManager.createNativeQuery(nativeQuery)).default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
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.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
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.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
useExecuteUpdate(Boolean useExecuteUpdate)
To configure whether to use executeUpdate() when producer executes a query.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
useExecuteUpdate(String useExecuteUpdate)
To configure whether to use executeUpdate() when producer executes a query.default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
usePersist(boolean usePersist)
Indicates to use entityManager.persist(entity) instead of entityManager.merge(entity).default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder
usePersist(String usePersist)
Indicates to use entityManager.persist(entity) instead of entityManager.merge(entity).
-
-
-
Method Detail
-
advanced
default JpaEndpointBuilderFactory.AdvancedJpaEndpointProducerBuilder 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder maximumResults(int 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder maximumResults(String 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder namedQuery(String 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder nativeQuery(String 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder query(String 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder resultClass(Class<Object> 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder resultClass(String 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder 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. 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder 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. 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder firstResult(int 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder firstResult(String 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder flushOnSend(boolean 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder flushOnSend(String 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder outputTarget(String 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder remove(boolean 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder remove(String 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder 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. The option is a: <code>boolean</code> type. Default: false Group: producer- Parameters:
singleResult
- the value to set- Returns:
- the dsl builder
-
singleResult
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder 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. 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder usePersist(boolean 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
default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder usePersist(String 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
-
-