I see this post is from about a year ago and have not been able to find any
other information regarding updates on this kind of use case.  Does anyone
know if there are any new capabilities or plans to add them that would allow
a webservice to pull data via the jpa component?  

It would be really great to be able to support full CRUD operations using
only the REST DSL and JPA.  Currently it is easy to support POST/CREATE via
code like the following:
<post type="com.bn.model.User" id="createUser">
   <to uri="jpa://com.bn.model.User" />
</post>

however, it does not appear work for RETRIEVE/GET operations like
<get uri="/list" outType="com.bn.model.User[]">
    <to uri="jpa:com.bn.model.User?consumer.query=from com.bn.model.User"/>
</get>

OR 

<get uri="/{id}" outType="com.bn.model.User">
    <to uri="jpa:com.bn.model.User?consumer.query=from com.bn.model.User u
where u.id = ${header.id}"/>
</get>


To work around it you either need to use the jdbc component, as mentioned,
which does not allow you to map to POJOs or alternatively, to use a bean
that then does the data access.
Should I make a feature request for this functionality, or is something
along these lines potentially already in the works?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Hibernate-with-restlet-tp5734306p5766083.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to