[ 
https://issues.apache.org/jira/browse/CAMEL-7550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15467647#comment-15467647
 ] 

Darius Cooper edited comment on CAMEL-7550 at 9/6/16 3:13 PM:
--------------------------------------------------------------

Since queries are supported only by JPA consumer, I imagine the typical use 
case is polling for records that fit some criteria. So, providing a key as the 
body of the message doesn't seem to fit this picture. 
I do think it would be nice to have queries (including em.find() ) supported by 
JPA producer, as I mentioned here 
[CAMEL-10265|https://issues.apache.org/jira/browse/CAMEL-10265]


was (Author: dariusx):
Since queries are supported only by JPA consumer, I imagine the typical use 
case is polling for records that fit some criteria. So, providing a key as the 
body of the message doesn't fit this picture. It would be nice to have queries 
(including em.find() ) supported by JPA producer, as I mentioned here 
[CAMEL-10265|https://issues.apache.org/jira/browse/CAMEL-10265]

> Adding ability to look up objects using EntityManager.find in JPA component.
> ----------------------------------------------------------------------------
>
>                 Key: CAMEL-7550
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7550
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jpa
>            Reporter: Knut-HÃ¥vard Aksnes
>            Priority: Minor
>             Fix For: Future
>
>
> Currently Camel-JPA offers 3 different ways of looking up objects
> # Using Query
> # Using NativeQuery
> # Using NamedQuery
> I would like a fourth: Using EntityManager.find
> EntityManager.find is simple to use and in many situations far more efficient 
> out of the box than the other options, at least when using Hibernate. This is 
> due to the fact that it uses the caches by default.
> The find method requires two arguments, one of them the key is natural to 
> provide as incoming body, the second, the class of the object wanted is 
> natural to have as a route parameter and/or header.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to