You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/07/16 12:10:53 UTC
(camel) 01/01: CAMEL-24131: camel-jpa - Guard consumeDelete handler against Object[] from native queries
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch fix/CAMEL-24131
in repository https://gitbox.apache.org/repos/asf/camel.git
commit f7afbbc15855fc29a882f252c9d03331fc2956e8
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Jul 16 14:10:36 2026 +0200
CAMEL-24131: camel-jpa - Guard consumeDelete handler against Object[] from native queries
Co-Authored-By: Claude Opus 4.6 <no...@anthropic.com>
Signed-off-by: Claus Ibsen <cl...@gmail.com>
---
.../src/main/java/org/apache/camel/component/jpa/JpaConsumer.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java b/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
index f826d8cdfb01..ade1e5b56c30 100644
--- a/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
+++ b/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
@@ -471,7 +471,11 @@ public class JpaConsumer extends ScheduledBatchPollingConsumer {
}
}
if (getEndpoint().isConsumeDelete()) {
- return (EntityManager em, Object entityBean, Exchange exchange) -> em.remove(entityBean);
+ return (EntityManager em, Object entityBean, Exchange exchange) -> {
+ if (entityBean != null && !entityBean.getClass().isArray()) {
+ em.remove(entityBean);
+ }
+ };
}
return (EntityManager em, Object entityBean, Exchange exchange) -> {