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 Detail

      • 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
      • 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
      • 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&lt;java.lang.Object&gt;</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&lt;java.lang.Object&gt;</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
      • 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
      • lazyStartProducer

        default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder lazyStartProducer​(boolean lazyStartProducer)
        Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. The option is a: <code>boolean</code> type. Default: false Group: producer
        Parameters:
        lazyStartProducer - the value to set
        Returns:
        the dsl builder
      • lazyStartProducer

        default JpaEndpointBuilderFactory.JpaEndpointProducerBuilder lazyStartProducer​(String lazyStartProducer)
        Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. The option will be converted to a <code>boolean</code> type. Default: false Group: producer
        Parameters:
        lazyStartProducer - 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
      • 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