Skip to content

Commit 2618221

Browse files
mp911deschauder
authored andcommitted
General removal of deprecated API.
See #2466
1 parent aecdf50 commit 2618221

20 files changed

+56
-461
lines changed

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.

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
*

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

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()

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}

src/main/java/org/springframework/data/repository/cdi/CdiRepositoryBean.java

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

336327
/**
337328
* Creates the actual component instance given a {@link RepositoryFactorySupport repository factory supplier} and the
@@ -417,24 +408,6 @@ private static Class<?> lookupFragmentInterface(Class<?> repositoryType, String
417408
Arrays.asList(repositoryType.getInterfaces()))));
418409
}
419410

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

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;
@@ -46,16 +45,6 @@ public interface ParameterAccessor extends Iterable<Object> {
4645
*/
4746
Sort getSort();
4847

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

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;
@@ -128,18 +127,6 @@ public Sort getSort() {
128127
return Sort.unsorted();
129128
}
130129

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

src/main/java/org/springframework/data/repository/support/PageableExecutionUtils.java

-54
This file was deleted.

src/main/java/org/springframework/data/repository/util/NullableWrapper.java

-42
This file was deleted.

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;
@@ -220,39 +218,6 @@ public static boolean isMultiValueType(Class<?> type) {
220218
: findDescriptor(type).map(ReactiveTypeDescriptor::isMultiValue).orElse(false);
221219
}
222220

223-
/**
224-
* Returns a collection of no-value wrapper types.
225-
*
226-
* @return a collection of no-value wrapper types.
227-
* @deprecated not supported anymore.
228-
*/
229-
@Deprecated
230-
public static Collection<Class<?>> getNoValueTypes() {
231-
return Collections.emptyList();
232-
}
233-
234-
/**
235-
* Returns a collection of single-value wrapper types.
236-
*
237-
* @return a collection of single-value wrapper types.
238-
* @deprecated not supported anymore.
239-
*/
240-
@Deprecated
241-
public static Collection<Class<?>> getSingleValueTypes() {
242-
return Collections.emptyList();
243-
}
244-
245-
/**
246-
* Returns a collection of multi-value wrapper types.
247-
*
248-
* @return a collection of multi-value wrapper types.
249-
* @deprecated not supported anymore.
250-
*/
251-
@Deprecated
252-
public static Collection<Class<?>> getMultiValueTypes() {
253-
return Collections.emptyList();
254-
}
255-
256221
/**
257222
* Returns whether the given type is a reactive wrapper type.
258223
*

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)