camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Babak Vahdat <babak.vah...@swissonline.ch>
Subject Re: Camel JPA - Parameterized Queries?
Date Fri, 14 Dec 2012 06:32:33 GMT


Am 14.12.12 03:16 schrieb "dmcamp" unter <dimacamp@gmail.com>:

>Yeah sure.
>I just created a custom bean which uses JPA to query what I need. So,
>instead of the jpa endpoint, y use my bean, and that's it.

You can also achieve this easily through two lines of code in a
Processor/Bean etc. as the JpaEndpoint already exposes a JpaTemplate for
such cases:


JpaTemplate jpaTemplate = context.getEndpoint("jpa:" +
MyEntity.class.getName(), JpaEndpoint.class).getTemplate();
List<MyEntity> myEntites = jpaTemplate.find("select x from
com.domain.MyEntity e where e.processDate < ?1", new Date());



Babak

>
>
>
>--
>View this message in context:
>http://camel.465427.n5.nabble.com/Camel-JPA-Parameterized-Queries-tp572404
>6p5724061.html
>Sent from the Camel - Users mailing list archive at Nabble.com.



Mime
View raw message