@@ -445,25 +445,32 @@ public void verify() {
445
445
if (isCollectionQuery () || isScrollQuery () || isSliceQuery () || isPageQuery () || isGeoNearQuery ()
446
446
|| !isNumericOrVoidReturnValue ()) { //
447
447
throw new IllegalStateException (
448
- String .format ("Update method may be void or return a numeric value (the number of updated documents)."
449
- + "Offending method: %s" , method ));
448
+ String .format (
449
+ "Update method may be void or return a numeric value (the number of updated documents)."
450
+ + " Offending Method: %s.%s" ,
451
+ ClassUtils .getShortName (method .getDeclaringClass ()), method .getName ()));
450
452
}
451
453
452
454
if (hasAnnotatedUpdate ()) { // must define either an update or an update pipeline
453
455
if (!StringUtils .hasText (getUpdateSource ().update ()) && ObjectUtils .isEmpty (getUpdateSource ().pipeline ())) {
454
456
throw new IllegalStateException (
455
- String .format ("Update method must define either 'Update#update' or 'Update#pipeline' attribute;"
456
- + " Offending method: %s" , method ));
457
+ String .format (
458
+ "Update method must define either 'Update#update' or 'Update#pipeline' attribute;"
459
+ + " Offending Method: %s.%s" ,
460
+ ClassUtils .getShortName (method .getDeclaringClass ()), method .getName ()));
457
461
}
458
462
}
459
463
}
464
+
460
465
if (hasAnnotatedAggregation ()) {
461
466
for (String stage : getAnnotatedAggregation ()) {
462
467
if (BsonUtils .isJsonArray (stage )) {
463
- throw new IllegalStateException ("""
464
- Invalid aggregation pipeline. Please split Aggregation.pipeline from "[{...}, {...}]" to "{...}", "{...}".
465
- Offending Method: %s.%s
466
- """ .formatted (method .getDeclaringClass ().getSimpleName (), method .getName ()));
468
+ throw new IllegalStateException (String .format (
469
+ """
470
+ Invalid aggregation pipeline. Please split the definition from @Aggregation("[{...}, {...}]") to @Aggregation({ "{...}", "{...}" }).
471
+ Offending Method: %s.%s
472
+ """ ,
473
+ ClassUtils .getShortName (method .getDeclaringClass ()), method .getName ()));
467
474
}
468
475
}
469
476
}
0 commit comments