Skip to content

Commit c697bee

Browse files
committed
General removal of deprecated API.
See #2466
1 parent 97c71b7 commit c697bee

20 files changed

+56
-460
lines changed

Diff for: src/main/java/org/springframework/data/auditing/AuditingHandler.java

+1-17
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919

2020
import org.apache.commons.logging.Log;
2121
import org.apache.commons.logging.LogFactory;
22+
2223
import org.springframework.beans.factory.InitializingBean;
2324
import org.springframework.data.domain.AuditorAware;
24-
import org.springframework.data.mapping.PersistentEntity;
25-
import org.springframework.data.mapping.PersistentProperty;
26-
import org.springframework.data.mapping.context.MappingContext;
2725
import org.springframework.data.mapping.context.PersistentEntities;
2826
import org.springframework.util.Assert;
2927

@@ -40,20 +38,6 @@ public class AuditingHandler extends AuditingHandlerSupport implements Initializ
4038

4139
private Optional<AuditorAware<?>> auditorAware;
4240

43-
/**
44-
* Creates a new {@link AuditableBeanWrapper} using the given {@link MappingContext} when looking up auditing metadata
45-
* via reflection.
46-
*
47-
* @param mappingContext must not be {@literal null}.
48-
* @since 1.8
49-
* @deprecated use {@link AuditingHandler(PersistentEntities)} instead.
50-
*/
51-
@Deprecated
52-
public AuditingHandler(
53-
MappingContext<? extends PersistentEntity<?, ?>, ? extends PersistentProperty<?>> mappingContext) {
54-
this(PersistentEntities.of(mappingContext));
55-
}
56-
5741
/**
5842
* Creates a new {@link AuditableBeanWrapper} using the given {@link PersistentEntities} when looking up auditing
5943
* metadata via reflection.

Diff for: src/main/java/org/springframework/data/auditing/IsNewAwareAuditingHandler.java

-13
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,6 @@ public class IsNewAwareAuditingHandler extends AuditingHandler {
3535

3636
private final PersistentEntities entities;
3737

38-
/**
39-
* Creates a new {@link IsNewAwareAuditingHandler} for the given {@link MappingContext}.
40-
*
41-
* @param mappingContext must not be {@literal null}.
42-
* @since 1.8
43-
* @deprecated use {@link IsNewAwareAuditingHandler(PersistentEntities)} instead.
44-
*/
45-
@Deprecated
46-
public IsNewAwareAuditingHandler(
47-
MappingContext<? extends PersistentEntity<?, ?>, ? extends PersistentProperty<?>> mappingContext) {
48-
this(PersistentEntities.of(mappingContext));
49-
}
50-
5138
/**
5239
* Creates a new {@link IsNewAwareAuditingHandler} for the given {@link MappingContext}.
5340
*

Diff for: src/main/java/org/springframework/data/mapping/PersistentProperty.java

-11
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,6 @@ public interface PersistentProperty<P extends PersistentProperty<P>> {
6464
*/
6565
TypeInformation<?> getTypeInformation();
6666

67-
/**
68-
* Returns the {@link TypeInformation} if the property references a {@link PersistentEntity}. Will return
69-
* {@literal null} in case it refers to a simple type. Will return {@link Collection}'s component type or the
70-
* {@link Map}'s value type transparently.
71-
*
72-
* @return
73-
* @deprecated since 2.6 for removal in 3.0. Use {@link #getPersistentEntityTypeInformation()} instead.
74-
*/
75-
@Deprecated
76-
Iterable<? extends TypeInformation<?>> getPersistentEntityTypes();
77-
7867
/**
7968
* Returns the detected {@link TypeInformation TypeInformations} if the property references a {@link PersistentEntity}.
8069
* Will return an {@literal empty} {@link Iterable} in case it refers to a simple type. Will return the {@link Collection}'s

Diff for: src/main/java/org/springframework/data/mapping/model/AbstractPersistentProperty.java

-9
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,6 @@ public TypeInformation<?> getTypeInformation() {
158158
return information;
159159
}
160160

161-
/*
162-
* (non-Javadoc)
163-
* @see org.springframework.data.mapping.PersistentProperty#getPersistentEntityTypes()
164-
*/
165-
@Override
166-
public Iterable<? extends TypeInformation<?>> getPersistentEntityTypes() {
167-
return getPersistentEntityTypeInformation();
168-
}
169-
170161
/*
171162
* (non-Javadoc)
172163
* @see org.springframework.data.mapping.PersistentProperty#getPersistentEntityTypeInformation()

Diff for: src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java

-20
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,6 @@ public class InstantiationAwarePropertyAccessor<T> implements PersistentProperty
4646

4747
private T bean;
4848

49-
/**
50-
* Creates an {@link InstantiationAwarePropertyAccessor} using the given delegate {@link PersistentPropertyAccessor}
51-
* and {@link EntityInstantiators}.
52-
*
53-
* @param delegate must not be {@literal null}.
54-
* @param instantiators must not be {@literal null}.
55-
* @deprecated since 2.4. Using this constructor allows only setting a single property as
56-
* {@link PersistentPropertyAccessor} holds a reference to the initial bean state.
57-
*/
58-
@Deprecated
59-
public InstantiationAwarePropertyAccessor(PersistentPropertyAccessor<T> delegate, EntityInstantiators instantiators) {
60-
61-
Assert.notNull(delegate, "Delegate PersistentPropertyAccessor must not be null!");
62-
Assert.notNull(instantiators, "EntityInstantiators must not be null!");
63-
64-
this.instantiators = instantiators;
65-
this.delegateFunction = t -> delegate;
66-
this.bean = delegate.getBean();
67-
}
68-
6949
/**
7050
* Creates an {@link InstantiationAwarePropertyAccessor} using the given delegate {@code accessorFunction} and
7151
* {@link EntityInstantiators}. {@code accessorFunction} is used to obtain a new {@link PersistentPropertyAccessor}

Diff for: src/main/java/org/springframework/data/repository/cdi/CdiRepositoryBean.java

+1-28
Original file line numberDiff line numberDiff line change
@@ -320,16 +320,7 @@ public String getId() {
320320
* @param repositoryType will never be {@literal null}.
321321
* @return
322322
*/
323-
protected T create(CreationalContext<T> creationalContext, Class<T> repositoryType) {
324-
325-
CdiRepositoryConfiguration cdiRepositoryConfiguration = lookupConfiguration(beanManager, qualifiers);
326-
327-
Optional<Bean<?>> customImplementationBean = getCustomImplementationBean(repositoryType,
328-
cdiRepositoryConfiguration);
329-
Optional<Object> customImplementation = customImplementationBean.map(this::getDependencyInstance);
330-
331-
return create(creationalContext, repositoryType, customImplementation);
332-
}
323+
protected abstract T create(CreationalContext<T> creationalContext, Class<T> repositoryType);
333324

334325
/**
335326
* Creates the actual component instance given a {@link RepositoryFactorySupport repository factory supplier} and the
@@ -415,24 +406,6 @@ private static Class<?> lookupFragmentInterface(Class<?> repositoryType, String
415406
Arrays.asList(repositoryType.getInterfaces()))));
416407
}
417408

418-
/**
419-
* Creates the actual component instance.
420-
*
421-
* @param creationalContext will never be {@literal null}.
422-
* @param repositoryType will never be {@literal null}.
423-
* @param customImplementation can be {@literal null}.
424-
* @return
425-
* @deprecated since 2.1, override {@link #create(CreationalContext, Class)} in which you create a repository factory
426-
* and call {@link #create(RepositoryFactorySupport, Class, RepositoryFragments)}.
427-
*/
428-
@Deprecated
429-
protected T create(CreationalContext<T> creationalContext, Class<T> repositoryType,
430-
Optional<Object> customImplementation) {
431-
throw new UnsupportedOperationException(
432-
"You have to implement create(CreationalContext<T>, Class<T>, Optional<Object>) "
433-
+ "in order to use custom repository implementations");
434-
}
435-
436409
/**
437410
* Looks up an instance of a {@link CdiRepositoryConfiguration}. In case the instance cannot be found within the CDI
438411
* scope, a default configuration is used.

Diff for: src/main/java/org/springframework/data/repository/query/ParameterAccessor.java

-11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package org.springframework.data.repository.query;
1717

1818
import java.util.Iterator;
19-
import java.util.Optional;
2019

2120
import org.springframework.data.domain.Pageable;
2221
import org.springframework.data.domain.Sort;
@@ -45,16 +44,6 @@ public interface ParameterAccessor extends Iterable<Object> {
4544
*/
4645
Sort getSort();
4746

48-
/**
49-
* Returns the dynamic projection type to be used when executing the query or {@literal null} if none is defined.
50-
*
51-
* @return
52-
* @since 1.12
53-
* @deprecated use {@link #findDynamicProjection()} instead.
54-
*/
55-
@Deprecated
56-
Optional<Class<?>> getDynamicProjection();
57-
5847
/**
5948
* Returns the dynamic projection type to be used when executing the query or {@literal null} if none is defined.
6049
*

Diff for: src/main/java/org/springframework/data/repository/query/ParametersParameterAccessor.java

-13
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package org.springframework.data.repository.query;
1717

1818
import java.util.Iterator;
19-
import java.util.Optional;
2019

2120
import org.springframework.data.domain.Pageable;
2221
import org.springframework.data.domain.Sort;
@@ -126,18 +125,6 @@ public Sort getSort() {
126125
return Sort.unsorted();
127126
}
128127

129-
/**
130-
* Returns the dynamic projection type if available, {@literal null} otherwise.
131-
*
132-
* @return
133-
*/
134-
public Optional<Class<?>> getDynamicProjection() {
135-
136-
return Optional.ofNullable(parameters.hasDynamicProjection() //
137-
? (Class<?>) values[parameters.getDynamicProjectionIndex()] //
138-
: null);
139-
}
140-
141128
/**
142129
* Returns the dynamic projection type if available, {@literal null} otherwise.
143130
*

Diff for: src/main/java/org/springframework/data/repository/support/PageableExecutionUtils.java

-53
This file was deleted.

Diff for: src/main/java/org/springframework/data/repository/util/NullableWrapper.java

-42
This file was deleted.

Diff for: src/main/java/org/springframework/data/repository/util/ReactiveWrappers.java

-35
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
import reactor.core.publisher.Mono;
2020

2121
import java.util.Arrays;
22-
import java.util.Collection;
23-
import java.util.Collections;
2422
import java.util.Optional;
2523

2624
import org.springframework.core.ReactiveAdapter;
@@ -205,39 +203,6 @@ public static boolean isMultiValueType(Class<?> type) {
205203
: findDescriptor(type).map(ReactiveTypeDescriptor::isMultiValue).orElse(false);
206204
}
207205

208-
/**
209-
* Returns a collection of no-value wrapper types.
210-
*
211-
* @return a collection of no-value wrapper types.
212-
* @deprecated not supported anymore.
213-
*/
214-
@Deprecated
215-
public static Collection<Class<?>> getNoValueTypes() {
216-
return Collections.emptyList();
217-
}
218-
219-
/**
220-
* Returns a collection of single-value wrapper types.
221-
*
222-
* @return a collection of single-value wrapper types.
223-
* @deprecated not supported anymore.
224-
*/
225-
@Deprecated
226-
public static Collection<Class<?>> getSingleValueTypes() {
227-
return Collections.emptyList();
228-
}
229-
230-
/**
231-
* Returns a collection of multi-value wrapper types.
232-
*
233-
* @return a collection of multi-value wrapper types.
234-
* @deprecated not supported anymore.
235-
*/
236-
@Deprecated
237-
public static Collection<Class<?>> getMultiValueTypes() {
238-
return Collections.emptyList();
239-
}
240-
241206
/**
242207
* Returns whether the given type is a reactive wrapper type.
243208
*

Diff for: src/main/java/org/springframework/data/util/Lazy.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ public class Lazy<T> implements Supplier<T> {
4646
* Creates a new {@link Lazy} instance for the given supplier.
4747
*
4848
* @param supplier
49-
* @deprecated prefer {@link Lazy#of(Supplier)}, to be turned private in 2.5.
5049
*/
51-
@Deprecated
52-
public Lazy(Supplier<? extends T> supplier) {
50+
private Lazy(Supplier<? extends T> supplier) {
5351
this(supplier, null, false);
5452
}
5553

0 commit comments

Comments
 (0)