Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,15 @@ protected DeleteHandler<Object> createDeleteHandler() {
}
}
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);
} else {
LOG.warn("Cannot auto-delete entity of type {} (e.g. native query result without resultClass)."
+ " Set consumeDelete=false or configure a resultClass.",
entityBean != null ? entityBean.getClass().getName() : "null");
}
};
}

return (EntityManager em, Object entityBean, Exchange exchange) -> {
Expand Down