diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java index c015fb5a4..fd014c2d3 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2021 the original author or authors. + * Copyright 2011-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -601,7 +601,9 @@ public interface MongoOperations extends FluentMongoOperations { * @param reduceFunction The JavaScript reduce function * @param entityClass The parametrized type of the returned list. Must not be {@literal null}. * @return The results of the map reduce operation + * @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}. */ + @Deprecated MapReduceResults mapReduce(String inputCollectionName, String mapFunction, String reduceFunction, Class entityClass); @@ -614,7 +616,9 @@ public interface MongoOperations extends FluentMongoOperations { * @param mapReduceOptions Options that specify detailed map-reduce behavior. * @param entityClass The parametrized type of the returned list. Must not be {@literal null}. * @return The results of the map reduce operation + * @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}. */ + @Deprecated MapReduceResults mapReduce(String inputCollectionName, String mapFunction, String reduceFunction, @Nullable MapReduceOptions mapReduceOptions, Class entityClass); @@ -628,7 +632,9 @@ public interface MongoOperations extends FluentMongoOperations { * @param reduceFunction The JavaScript reduce function * @param entityClass The parametrized type of the returned list. Must not be {@literal null}. * @return The results of the map reduce operation + * @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}. */ + @Deprecated MapReduceResults mapReduce(Query query, String inputCollectionName, String mapFunction, String reduceFunction, Class entityClass); @@ -642,7 +648,9 @@ public interface MongoOperations extends FluentMongoOperations { * @param mapReduceOptions Options that specify detailed map-reduce behavior * @param entityClass The parametrized type of the returned list. Must not be {@literal null}. * @return The results of the map reduce operation + * @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}. */ + @Deprecated MapReduceResults mapReduce(Query query, String inputCollectionName, String mapFunction, String reduceFunction, @Nullable MapReduceOptions mapReduceOptions, Class entityClass); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java index 2986df20c..3d159c6e9 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2021 the original author or authors. + * Copyright 2010-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1826,7 +1826,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, * @param resultType * @return * @since 2.1 + * @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}. */ + @Deprecated public List mapReduce(Query query, Class domainType, String inputCollectionName, String mapFunction, String reduceFunction, @Nullable MapReduceOptions mapReduceOptions, Class resultType) { diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java index 0f54bef68..ff04514ed 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java @@ -1599,7 +1599,9 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { * @param options additional options like output collection. Must not be {@literal null}. * @return a {@link Flux} emitting the result document sequence. Never {@literal null}. * @since 2.1 + * @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}. */ + @Deprecated Flux mapReduce(Query filterQuery, Class domainType, Class resultType, String mapFunction, String reduceFunction, MapReduceOptions options); @@ -1617,7 +1619,9 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { * @param options additional options like output collection. Must not be {@literal null}. * @return a {@link Flux} emitting the result document sequence. Never {@literal null}. * @since 2.1 + * @deprecated since 3.4 in favor of {@link #aggregate(TypedAggregation, Class)}. */ + @Deprecated Flux mapReduce(Query filterQuery, Class domainType, String inputCollectionName, Class resultType, String mapFunction, String reduceFunction, MapReduceOptions options); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceCounts.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceCounts.java index 92ec228c7..70fc9767f 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceCounts.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceCounts.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2021 the original author or authors. + * Copyright 2010-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,9 @@ package org.springframework.data.mongodb.core.mapreduce; * * @author Mark Pollack * @author Oliver Gierke + * @deprecated since 3.4 in favor of {@link org.springframework.data.mongodb.core.aggregation}. */ +@Deprecated public class MapReduceCounts { public static final MapReduceCounts NONE = new MapReduceCounts(-1, -1, -1); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceOptions.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceOptions.java index 414d602a4..23bd9e5ea 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceOptions.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2021 the original author or authors. + * Copyright 2010-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,9 @@ import com.mongodb.client.model.MapReduceAction; * @author Oliver Gierke * @author Christoph Strobl * @author Mark Paluch + * @deprecated since 3.4 in favor of {@link org.springframework.data.mongodb.core.aggregation}. */ +@Deprecated public class MapReduceOptions { private @Nullable String outputCollection; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceResults.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceResults.java index 2936aff72..1f496f0bf 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceResults.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceResults.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2021 the original author or authors. + * Copyright 2011-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,9 @@ import org.springframework.util.Assert; * @author Christoph Strobl * @author Mark Paluch * @param The class in which the results are mapped onto, accessible via an iterator. + * @deprecated since 3.4 in favor of {@link org.springframework.data.mongodb.core.aggregation}. */ +@Deprecated public class MapReduceResults implements Iterable { private final List mappedResults; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceTiming.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceTiming.java index bb9907603..f844e7737 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceTiming.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/MapReduceTiming.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2021 the original author or authors. + * Copyright 2010-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,10 @@ */ package org.springframework.data.mongodb.core.mapreduce; +/** + * @deprecated since 3.4 in favor of {@link org.springframework.data.mongodb.core.aggregation}. + */ +@Deprecated public class MapReduceTiming { private long mapTime, emitLoopTime, totalTime; diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/package-info.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/package-info.java index 54781e78c..44a157807 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/package-info.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/package-info.java @@ -1,6 +1,7 @@ /** * Support for MongoDB map-reduce operations. */ +@Deprecated @org.springframework.lang.NonNullApi package org.springframework.data.mongodb.core.mapreduce;