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
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 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:
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