Hi

There is a usePersist option on JPA.

And check the source code of JpaProducer.
It should call merge, which ought to do an insert or update.

I suggest to check JPA documentation about the requirements for the
merge operation.
I would assume somehow you need data in your POJO that can match so
the JPA knows if its should do a SQL INSERT or SQL UPDATE.



On Thu, Mar 29, 2012 at 2:09 PM, Borut Bolčina <borut.bolc...@gmail.com> wrote:
> Hello,
>
> I do not dare to hope there is a one liner in Java DSL using JPA component
> to update records such as:
>
> ...
> .to("jpa:my.model.entities.weather.WeatherCurrent?persistenceUnit=weather"&unique=someDbColumn)
>
>
>
> I am successfully ADDING the records, but I want to update them. Let's say
> there was an imaginary option 'unique' as above , so
> the underlying machinery could update the record based on given unique db
> column.
>
> But what about now - how is camel solving this pretty much common problem?
>
> Just to be sure I am clearly explaining things: I will periodically produce
> a set of Weather pojos and one field will hold an id and based on this id
> which is also in the corresponding db table (not primary key), the data
> should be updated (overwritten).
>
> -borut



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to