gpt4 book ai didi

jpa - Camel pollEnrich JPA 忽略 namedQuery

转载 作者:行者123 更新时间:2023-12-05 08:09:02 25 4
gpt4 key购买 nike

使用 JPA Consumer、transform 和其他中间路线操作构建 Camel ETL 路线示例。这包括针对另一个 JPA 实体的额外 pollEnrich 步骤。 pollEnrich 步骤应该使用基于定义的带有动态参数的命名查询的实体数据(通过先前交换的#params 注册表映射传递)。它完全忽略了 namedQuery。它还会忽略任何内联查询 - 无论查询多么简单 - 并简单地轮询初始记录直到 maximumResults。

from("jpa:com.tcfbank.example.entity.PersonEntity?maxMessagesPerPoll=500&persistenceUnit=cedb&consumer.namedQuery=withOccupationCodeAndValidIdentification&consumer.initialDelay=3000&delay=3000&consumeDelete=false&consumeLockEntity=false")
.convertBodyTo(CanonicalPerson.class)
.to("bean:parameterManager")
.pollEnrich("jpa:com.tcfbank.example.entity.AccountEntity?persistenceUnit=cedb2&consumer.resultClass=com.tcfbank.example.entity.AccountEntity&consumer.namedQuery=byCustomerId&consumer.parameters=#params&consumeDelete=false&consumeLockEntity=false&maximumResults=50", 5000, "accountAggregationStrategy").id("EnrichWithAccounts")
.to("bean:scoringClient")
.setHeader(Exchange.FILE_NAME, el("${in.body.customerId}.xml"))
.to("file:target/customers");

最佳答案

pollEnrich不是jpaconsumer而是pollingconsumer,去掉参数中的前缀consumer

.pollEnrich("jpa:com.tcfbank.example.entity.AccountEntity?persistenceUnit=cedb2&<strike>consumer.</strike>resultClass=com.tcfbank.example.entity.AccountEntity&<strike>consumer.</strike>namedQuery=byCustomerId&<strike>consumer.</strike>parameters=#params&consumeDelete=false&consumeLockEntity=false&maximumResults=50", 5000, "accountAggregationStrategy").id("EnrichWithAccounts")

关于jpa - Camel pollEnrich JPA 忽略 namedQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42123269/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com