Re: Updating database records with Java DSL JPA component

2012-04-02 Thread Borut Bolčina
Hi, after accepting the fact that I won't be having nice integer primary keys and instead use some unique value from XML fragment (which in turn becomes pojo), the solution is dead simple. Again, I removed some code, not added! Using Camel really, really shortens your code. So, instead of: @Id

Re: Updating database records with Java DSL JPA component

2012-03-31 Thread Claus Ibsen
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

Re: Updating database records with Java DSL JPA component

2012-03-29 Thread Christian Müller
The Camel JPA component doesn't support this use case at present, but I think it would be useful. Feel free to raise a JIRA [1] for it. And as you may know, we love contributions [2], [3]... ;-) [1] http://camel.apache.org/contributing.html [2] https://issues.apache.org/jira/browse/CAMEL [3] http:

Updating database records with Java DSL JPA component

2012-03-29 Thread Borut Bolčina
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