THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
from("jpa://org.apache.camel.examples.MultiSteps?consumer.namedQuery=step1") .to("bean:myBusinessLogic"); |
Using a consumer with a query
For consuming only selected entities, you can use the consumer.query
URI query option. You only have to define the query option:
Code Block |
---|
from("jpa://org.apache.camel.examples.MultiSteps?consumer.query=select o from " + entityName + " o where o.step = 1")
.to("bean:myBusinessLogic");
|
Using a consumer with a native query
For consuming only selected entities, you can use the consumer.nativeQuery
URI query option. You only have to define the native query option:
Code Block |
---|
from("jpa://org.apache.camel.examples.MultiSteps?consumer.nativeQuery=select * from MultiSteps where step = 1")
.to("bean:myBusinessLogic");
|
If you use the native query option, you will receive an object array in the message body.
Example
See Tracer Example for an example using JPA to store traced messages into a database.
...