camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Update database using Java DSL JPA
Date Tue, 05 Mar 2013 17:15:07 GMT
On Mon, Mar 4, 2013 at 8:14 PM, golivamsi84 <> wrote:
> thanks, it worked.
> But this is my other question, is it ok to write that logic in the Entity
> bean class? or should this logic be part of the class where the route is
> defined. Asking, so that I am following best practices.

JPA is about abstracting the database and work with Java beans.

You can take a look at some examples using SQL or Hibernate

> Since I am already here, I will ask the next question: Say I have table A
> and table B
> Now I need to update one of the column in table B with a value that I get
> from table A. To be exact, so based on some criteria I need to pull a column
> value in table A, then take that column value and update a column in table B
> with the value I pulled from table A.

Yeah with JPA its possible easier to use the JPA API directly from a
java bean and call that bean from a Camel route.

If using SQL, MyBatis you can though just call the SQL that would do
this update.

> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message