SGF-595 - Adapt to API changes in Spring Data Commons.

(cherry picked from commit e1b51b75d62702bb2c7b69fa240173186acfadb3)

Signed-off-by: John Blum <jblum@pivotal.io>
This commit is contained in:
Oliver Gierke
2017-03-23 13:28:14 +01:00
committed by John Blum
parent 9f52323b69
commit cb8fb251a9
2 changed files with 1 additions and 54 deletions

View File

@@ -16,9 +16,6 @@
package org.springframework.data.gemfire.mapping;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import org.springframework.data.gemfire.mapping.model.GemfireSimpleTypeHolder;
import org.springframework.data.mapping.context.AbstractMappingContext;
import org.springframework.data.mapping.model.MutablePersistentEntity;
@@ -67,14 +64,4 @@ public class GemfireMappingContext extends AbstractMappingContext<GemfirePersist
return new GemfirePersistentProperty(property, owner, simpleTypeHolder);
}
/**
* @deprecated use {@link #createPersistentProperty(Property, GemfirePersistentEntity, SimpleTypeHolder)} instead
*/
@Deprecated
protected GemfirePersistentProperty createPersistentProperty(Field field, PropertyDescriptor propertyDescriptor,
GemfirePersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) {
return new GemfirePersistentProperty(field, propertyDescriptor, owner, simpleTypeHolder);
}
}

View File

@@ -16,15 +16,11 @@
package org.springframework.data.gemfire.mapping;
import static org.springframework.data.gemfire.util.CollectionUtils.asSet;
import static org.springframework.data.gemfire.util.CollectionUtils.*;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.util.Optional;
import java.util.Set;
import org.springframework.data.annotation.Id;
import org.springframework.data.gemfire.mapping.model.GemfireSimpleTypeHolder;
import org.springframework.data.mapping.Association;
import org.springframework.data.mapping.PersistentEntity;
import org.springframework.data.mapping.PersistentProperty;
@@ -41,41 +37,6 @@ public class GemfirePersistentProperty extends AnnotationBasedPersistentProperty
protected static final Set<String> SUPPORTED_IDENTIFIER_NAMES = asSet("id");
/* (non-Javadoc) */
private static Property newProperty(Field field, PropertyDescriptor propertyDescriptor) {
return Optional.ofNullable(field)
.map((theField) -> Property.of(theField, Optional.ofNullable(propertyDescriptor)))
.orElseGet(() -> Property.of(propertyDescriptor));
}
/* (non-Javadoc) */
private static SimpleTypeHolder resolveSimpleTypeHolder(SimpleTypeHolder source) {
return (source instanceof GemfireSimpleTypeHolder ? source
: (source != null ? new GemfireSimpleTypeHolder(source) : new GemfireSimpleTypeHolder()));
}
/**
* Constructs an instance of {@link GemfirePersistentProperty} initialized with entity persistent property
* information (meta-data).
*
* @param field {@link GemfirePersistentEntity entity} {@link Field} for the persistent property.
* @param propertyDescriptor {@link PropertyDescriptor} for the {@link GemfirePersistentEntity entity's}
* persistent property.
* @param owner {@link GemfirePersistentEntity entity} owning the persistent property.
* @param simpleTypeHolder {@link SimpleTypeHolder} used to handle primitive types.
* @see #GemfirePersistentProperty(Property, PersistentEntity, SimpleTypeHolder)
* @see #newProperty(Field, PropertyDescriptor)
* @see org.springframework.data.mapping.PersistentEntity
* @see org.springframework.data.mapping.PersistentProperty
* @see org.springframework.data.mapping.model.SimpleTypeHolder
* @see java.beans.PropertyDescriptor
* @see java.lang.reflect.Field
*/
public GemfirePersistentProperty(Field field, PropertyDescriptor propertyDescriptor,
PersistentEntity<?, GemfirePersistentProperty> owner, SimpleTypeHolder simpleTypeHolder) {
this(newProperty(field, propertyDescriptor), owner, resolveSimpleTypeHolder(simpleTypeHolder));
}
/**
* Constructs an instance of {@link GemfirePersistentProperty} initialized with entity persistent property
@@ -92,7 +53,6 @@ public class GemfirePersistentProperty extends AnnotationBasedPersistentProperty
*/
public GemfirePersistentProperty(Property property, PersistentEntity<?, GemfirePersistentProperty> owner,
SimpleTypeHolder simpleTypeHolder) {
super(property, owner, simpleTypeHolder);
}