Skip to content

Commit b4b8aa3

Browse files
committed
Missing hint issue when defining a custom MongoTemplate.
1 parent 7c81b2c commit b4b8aa3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/aot/MongoRuntimeHints.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.springframework.aot.hint.RuntimeHints;
2424
import org.springframework.aot.hint.RuntimeHintsRegistrar;
2525
import org.springframework.aot.hint.TypeReference;
26+
import org.springframework.data.mongodb.core.aggregation.AggregationOperation;
2627
import org.springframework.data.mongodb.core.mapping.event.AfterConvertCallback;
2728
import org.springframework.data.mongodb.core.mapping.event.AfterSaveCallback;
2829
import org.springframework.data.mongodb.core.mapping.event.BeforeConvertCallback;
@@ -47,6 +48,7 @@
4748
*
4849
* @author Christoph Strobl
4950
* @author Mark Paluch
51+
* @author Omer Celik
5052
* @since 4.0
5153
*/
5254
class MongoRuntimeHints implements RuntimeHintsRegistrar {
@@ -56,7 +58,8 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
5658

5759
hints.reflection().registerTypes(
5860
Arrays.asList(TypeReference.of(BeforeConvertCallback.class), TypeReference.of(BeforeSaveCallback.class),
59-
TypeReference.of(AfterConvertCallback.class), TypeReference.of(AfterSaveCallback.class)),
61+
TypeReference.of(AfterConvertCallback.class), TypeReference.of(AfterSaveCallback.class),
62+
TypeReference.of(AggregationOperation.class)),
6063
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
6164
MemberCategory.INVOKE_PUBLIC_METHODS));
6265

0 commit comments

Comments
 (0)