DATACMNS-1496 - Removed deprecations at least introduced in Lovelace.

This commit is contained in:
Oliver Drotbohm
2019-03-13 16:21:31 +01:00
parent 78e635fba9
commit 0bf160eb97
39 changed files with 63 additions and 1901 deletions

View File

@@ -114,7 +114,7 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
this.applicationEventPublisher = applicationEventPublisher;
}
/*
/*
* (non-Javadoc)
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
*/
@@ -285,15 +285,6 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
}
/*
* (non-Javadoc)
* @see org.springframework.data.mapping.context.MappingContext#getPersistentPropertyPath(org.springframework.data.mapping.context.InvalidPersistentPropertyPath)
*/
@Override
public PersistentPropertyPath<P> getPersistentPropertyPath(InvalidPersistentPropertyPath invalidPath) {
return persistentPropertyPathFactory.from(invalidPath.getType(), invalidPath.getResolvedPath());
}
/*
* (non-Javadoc)
* @see org.springframework.data.mapping.context.MappingContext#findPersistentPropertyPath(java.lang.Class, java.util.function.Predicate)
*/
@@ -310,7 +301,7 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
* Actually looks up the {@link PersistentPropertyPaths} for the given type, selection predicate and traversal guard.
* Primary purpose is to allow sub-types to alter the default traversal guard, e.g. used by
* {@link #findPersistentPropertyPaths(Class, Predicate)}.
*
*
* @param type will never be {@literal null}.
* @param predicate will never be {@literal null}.
* @param traversalGuard will never be {@literal null}.

View File

@@ -173,26 +173,12 @@ public interface MappingContext<E extends PersistentEntity<?, P>, P extends Pers
PersistentPropertyPath<P> getPersistentPropertyPath(String propertyPath, Class<?> type)
throws InvalidPersistentPropertyPath;
/**
* Returns the {@link PersistentPropertyPath} for the resolvable part of the given
* {@link InvalidPersistentPropertyPath}.
*
* @param invalidPath must not be {@literal null}.
* @return the {@link PersistentPropertyPath} for the resolvable part of the given
* {@link InvalidPersistentPropertyPath}.
* @since 1.11
* @deprecated since 2.0, use {@link #getPersistentPropertyPath(PropertyPath)} with
* {@link InvalidPersistentPropertyPath#getResolvedPath()} instead.
*/
@Deprecated
PersistentPropertyPath<P> getPersistentPropertyPath(InvalidPersistentPropertyPath invalidPath);
/**
* Returns all {@link PersistentPropertyPath}s pointing to properties on the given type that match the given
* {@link Predicate}. In case of circular references the detection will stop at the property that references a type
* that's already included in the path. Note, that is is a potentially expensive operation as results cannot be
* cached.
*
*
* @param type must not be {@literal null}.
* @param predicate must not be {@literal null}.
* @return

View File

@@ -1,77 +0,0 @@
/*
* Copyright 2012-2019 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.mapping.context;
import org.springframework.data.mapping.PersistentEntity;
import org.springframework.data.support.IsNewStrategy;
import org.springframework.data.support.IsNewStrategyFactory;
import org.springframework.data.support.IsNewStrategyFactorySupport;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
* An {@link IsNewStrategyFactory} using a {@link MappingContext} to determine the {@link IsNewStrategy} to be returned
* for a particular type. It will look for a version and id property on the {@link PersistentEntity} and return a
* strategy instance that will reflectively inspect the property for {@literal null} values or {@literal null} or a
* value of 0 in case of a version property.
*
* @author Oliver Gierke
* @author Mark Paluch
* @deprecated as of 2.1 in favor of looking up the {@link PersistentEntity} and calling
* {@link PersistentEntity#isNew(Object)} on it
*/
@Deprecated
public class MappingContextIsNewStrategyFactory extends IsNewStrategyFactorySupport {
private final PersistentEntities entities;
/**
* Creates a new {@link MappingContextIsNewStrategyFactory} using the given {@link MappingContext}.
*
* @param context must not be {@literal null}.
* @deprecated use {@link MappingContextIsNewStrategyFactory(PersistentEntities)} instead.
*/
@Deprecated
public MappingContextIsNewStrategyFactory(MappingContext<? extends PersistentEntity<?, ?>, ?> context) {
this(PersistentEntities.of(context));
}
/**
* Creates a new {@link MappingContextIsNewStrategyFactory} using the given {@link PersistentEntities}.
*
* @param entities must not be {@literal null}.
* @since 1.10
*/
public MappingContextIsNewStrategyFactory(PersistentEntities entities) {
Assert.notNull(entities, "PersistentEntities must not be null!");
this.entities = entities;
}
/*
* (non-Javadoc)
* @see org.springframework.data.support.IsNewStrategyFactorySupport#getFallBackStrategy(java.lang.Class)
*/
@Nullable
@Override
protected IsNewStrategy doGetIsNewStrategy(Class<?> type) {
PersistentEntity<?, ?> entity = entities.getRequiredPersistentEntity(type);
return bean -> entity.isNew(bean);
}
}