182.11. 使用带有原生查询的消费者
对于只使用所选实体,您可以使用 consumer.nativeQuery URI 查询选项。您只需要定义原生查询选项:
from("jpa://org.apache.camel.examples.MultiSteps?consumer.nativeQuery=select * from MultiSteps where step = 1")
.to("bean:myBusinessLogic");
from("jpa://org.apache.camel.examples.MultiSteps?consumer.nativeQuery=select * from MultiSteps where step = 1")
.to("bean:myBusinessLogic");
如果使用 native query 选项,您将在消息正文中收到一个对象数组。