-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed as duplicate of#4015
Labels
status: duplicateA duplicate of another issueA duplicate of another issue
Description
I've just upgraded my spring-boot app to 3.5.6, which updates also spring-data to 3.5.4
After the upgrade, our methods
which look like
long deleteBySomeAttr(int val);
result in error
Null return value from advice does not match primitive return type for: ...
I think it can be related to 72dd53a#diff-dc360e9f00538d98dbdafa414534e321b68fe0e293fbefe37bacdb5e76cd3315R58-L411
where return value was changed from
return jpaQuery.getQueryMethod().isCollectionQuery() ? resultList : resultList.size();
to
return collectionQuery ? resultList : CollectionUtils.firstElement(resultList);
so when no value is deleted, null is returned, and is not converted to 0 (we have "long" as return value)
This is a breaking change in 3.5.x release. I'm not sure which is the correct way of solving this problem. Is it a bug, or return of "long" is not allowed from now on.
Metadata
Metadata
Assignees
Labels
status: duplicateA duplicate of another issueA duplicate of another issue