camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
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 <golivamsi84@gmail.com> 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
http://camel.apache.org/sql-example.html
http://camel.apache.org/hibernate-example.html


> 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: http://camel.465427.n5.nabble.com/Update-database-using-Java-DSL-JPA-tp5728463p5728482.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message