I have a bunch of JPA Entities that I retrieve like this:
.handle(Jpa.retrievingGateway(myEntityManagerFactory).namedQuery(readQuery))
.transform(/* remove some of the entities from the message, leaving only the ones I want to delete */)
And now I would like to delete some of them. What is the best way to do this ? I'm thinking there must be some simple way to do it with a very simple or possibly even no explicit jpaQuery() at all ?
I'm imagining something like this:
.handle(Jpa.updatingGateway(myEntityManagerFactory)
.jpaQuery("delete from MyTable m where m in :items")
.parameter("items", ...(?)... )
or like this:
.handle(Jpa.deletingGateway(myEntityManagerFactory))
What's the right way to do this with the Spring Integration DSL ?