@@ -493,25 +493,32 @@ public void verify() {
493
493
if (isCollectionQuery () || isScrollQuery () || isSliceQuery () || isPageQuery () || isGeoNearQuery ()
494
494
|| !isNumericOrVoidReturnValue ()) { //
495
495
throw new IllegalStateException (
496
- String .format ("Update method may be void or return a numeric value (the number of updated documents)."
497
- + "Offending method: %s" , method ));
496
+ String .format (
497
+ "Update method may be void or return a numeric value (the number of updated documents)."
498
+ + " Offending Method: %s.%s" ,
499
+ ClassUtils .getShortName (method .getDeclaringClass ()), method .getName ()));
498
500
}
499
501
500
502
if (hasAnnotatedUpdate ()) { // must define either an update or an update pipeline
501
503
if (!StringUtils .hasText (getUpdateSource ().update ()) && ObjectUtils .isEmpty (getUpdateSource ().pipeline ())) {
502
504
throw new IllegalStateException (
503
- String .format ("Update method must define either 'Update#update' or 'Update#pipeline' attribute;"
504
- + " Offending method: %s" , method ));
505
+ String .format (
506
+ "Update method must define either 'Update#update' or 'Update#pipeline' attribute;"
507
+ + " Offending Method: %s.%s" ,
508
+ ClassUtils .getShortName (method .getDeclaringClass ()), method .getName ()));
505
509
}
506
510
}
507
511
}
512
+
508
513
if (hasAnnotatedAggregation ()) {
509
514
for (String stage : getAnnotatedAggregation ()) {
510
515
if (BsonUtils .isJsonArray (stage )) {
511
- throw new IllegalStateException ("""
512
- Invalid aggregation pipeline. Please split Aggregation.pipeline from "[{...}, {...}]" to "{...}", "{...}".
513
- Offending Method: %s.%s
514
- """ .formatted (method .getDeclaringClass ().getSimpleName (), method .getName ()));
516
+ throw new IllegalStateException (String .format (
517
+ """
518
+ Invalid aggregation pipeline. Please split the definition from @Aggregation("[{...}, {...}]") to @Aggregation({ "{...}", "{...}" }).
519
+ Offending Method: %s.%s
520
+ """ ,
521
+ ClassUtils .getShortName (method .getDeclaringClass ()), method .getName ()));
515
522
}
516
523
}
517
524
}
0 commit comments