SGF-548 - Add the org.springframework.data.gemfire.mapping.annotation package.

This commit is contained in:
John Blum
2016-12-12 19:38:45 -08:00
parent aedfcdfb8e
commit c982d6ee74
43 changed files with 88 additions and 82 deletions

View File

@@ -63,7 +63,7 @@ public @interface EnableEntityDefinedRegions {
String[] value() default {};
/**
* Base packages to scan for {@link org.springframework.data.gemfire.mapping.Region @Region} annotated
* Base packages to scan for {@link org.springframework.data.gemfire.mapping.annotation.Region @Region} annotated
* application persistent entities. {@link #value()} is an alias for this attribute.
* Use {@link #basePackageClasses()} for a type-safe alternative to String-based package names.
*
@@ -75,7 +75,7 @@ public @interface EnableEntityDefinedRegions {
/**
* Type-safe alternative to {@link #basePackages()} for specifying the packages to scan for
* {@link org.springframework.data.gemfire.mapping.Region @Region} annotated application persistent entities.
* {@link org.springframework.data.gemfire.mapping.annotation.Region @Region} annotated application persistent entities.
* The package of each class specified will be scanned. Consider creating a special no-op marker class or interface
* in each package that serves no other purpose than being referenced by this attribute.
*

View File

@@ -61,12 +61,12 @@ import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.support.GemFireCacheTypeAwareRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.support.GemFireComponentClassTypeScanner;
import org.springframework.data.gemfire.config.xml.GemfireConstants;
import org.springframework.data.gemfire.mapping.ClientRegion;
import org.springframework.data.gemfire.mapping.GemfireMappingContext;
import org.springframework.data.gemfire.mapping.GemfirePersistentEntity;
import org.springframework.data.gemfire.mapping.LocalRegion;
import org.springframework.data.gemfire.mapping.PartitionRegion;
import org.springframework.data.gemfire.mapping.ReplicateRegion;
import org.springframework.data.gemfire.mapping.annotation.ClientRegion;
import org.springframework.data.gemfire.mapping.annotation.LocalRegion;
import org.springframework.data.gemfire.mapping.annotation.PartitionRegion;
import org.springframework.data.gemfire.mapping.annotation.ReplicateRegion;
import org.springframework.data.gemfire.util.ArrayUtils;
import org.springframework.data.gemfire.util.CollectionUtils;
import org.springframework.util.Assert;
@@ -93,13 +93,13 @@ import org.springframework.util.StringUtils;
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see org.springframework.data.gemfire.config.annotation.support.GemFireCacheTypeAwareRegionFactoryBean
* @see org.springframework.data.gemfire.config.annotation.support.GemFireComponentClassTypeScanner
* @see org.springframework.data.gemfire.mapping.ClientRegion
* @see ClientRegion
* @see org.springframework.data.gemfire.mapping.GemfireMappingContext
* @see org.springframework.data.gemfire.mapping.GemfirePersistentEntity
* @see org.springframework.data.gemfire.mapping.LocalRegion
* @see org.springframework.data.gemfire.mapping.PartitionRegion
* @see org.springframework.data.gemfire.mapping.ReplicateRegion
* @see org.springframework.data.gemfire.mapping.Region
* @see LocalRegion
* @see PartitionRegion
* @see ReplicateRegion
* @see org.springframework.data.gemfire.mapping.annotation.Region
* @since 1.9.0
*/
public class EntityDefinedRegionsConfiguration
@@ -116,7 +116,7 @@ public class EntityDefinedRegionsConfiguration
regionAnnotationToRegionFactoryBeanClass.put(LocalRegion.class, LocalRegionFactoryBean.class);
regionAnnotationToRegionFactoryBeanClass.put(PartitionRegion.class, PartitionedRegionFactoryBean.class);
regionAnnotationToRegionFactoryBeanClass.put(ReplicateRegion.class, ReplicatedRegionFactoryBean.class);
regionAnnotationToRegionFactoryBeanClass.put(org.springframework.data.gemfire.mapping.Region.class,
regionAnnotationToRegionFactoryBeanClass.put(org.springframework.data.gemfire.mapping.annotation.Region.class,
DEFAULT_REGION_FACTORY_BEAN_CLASS);
}
@@ -386,7 +386,7 @@ public class EntityDefinedRegionsConfiguration
Set<TypeFilter> regionAnnotatedPersistentEntityTypeFilters = new HashSet<>();
for (Class<? extends Annotation> annotationType :
org.springframework.data.gemfire.mapping.Region.REGION_ANNOTATION_TYPES) {
org.springframework.data.gemfire.mapping.annotation.Region.REGION_ANNOTATION_TYPES) {
regionAnnotatedPersistentEntityTypeFilters.add(new AnnotationTypeFilter(annotationType));
}

View File

@@ -31,7 +31,7 @@ import org.springframework.data.gemfire.IndexType;
import org.springframework.data.gemfire.config.xml.GemfireConstants;
import org.springframework.data.gemfire.mapping.GemfirePersistentEntity;
import org.springframework.data.gemfire.mapping.GemfirePersistentProperty;
import org.springframework.data.gemfire.mapping.Indexed;
import org.springframework.data.gemfire.mapping.annotation.Indexed;
import org.springframework.data.mapping.PropertyHandler;
import org.springframework.util.StringUtils;
@@ -51,7 +51,7 @@ import org.springframework.util.StringUtils;
* @see org.springframework.data.gemfire.config.annotation.EntityDefinedRegionsConfiguration
* @see org.springframework.data.gemfire.mapping.GemfirePersistentEntity
* @see org.springframework.data.gemfire.mapping.GemfirePersistentProperty
* @see org.springframework.data.gemfire.mapping.Indexed
* @see Indexed
* @see org.apache.geode.cache.Region
* @see org.apache.geode.cache.query.Index
* @since 1.9.0

View File

@@ -23,6 +23,11 @@ import java.lang.annotation.Annotation;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.data.gemfire.mapping.annotation.ClientRegion;
import org.springframework.data.gemfire.mapping.annotation.LocalRegion;
import org.springframework.data.gemfire.mapping.annotation.PartitionRegion;
import org.springframework.data.gemfire.mapping.annotation.Region;
import org.springframework.data.gemfire.mapping.annotation.ReplicateRegion;
import org.springframework.data.mapping.PersistentEntity;
import org.springframework.data.mapping.model.BasicPersistentEntity;
import org.springframework.data.util.TypeInformation;
@@ -88,11 +93,11 @@ public class GemfirePersistentEntity<T> extends BasicPersistentEntity<T, Gemfire
* @param <T> concrete {@link Class} type of the Region {@link Annotation}.
* @return the {@link Region} annotation used to annotate this {@link PersistentEntity} or {@literal null}
* if this {@link PersistentEntity} was not annotated with a {@link Region} annotation.
* @see org.springframework.data.gemfire.mapping.ClientRegion
* @see org.springframework.data.gemfire.mapping.LocalRegion
* @see org.springframework.data.gemfire.mapping.PartitionRegion
* @see org.springframework.data.gemfire.mapping.ReplicateRegion
* @see org.springframework.data.gemfire.mapping.Region
* @see ClientRegion
* @see LocalRegion
* @see PartitionRegion
* @see ReplicateRegion
* @see Region
* @see java.lang.annotation.Annotation
*/
@SuppressWarnings("unchecked")

View File

@@ -15,7 +15,7 @@
*
*/
package org.springframework.data.gemfire.mapping;
package org.springframework.data.gemfire.mapping.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
@@ -35,7 +35,7 @@ import org.springframework.data.gemfire.config.xml.GemfireConstants;
* persistent entity will be stored.
*
* @author John Blum
* @see org.springframework.data.gemfire.mapping.Region
* @see Region
* @since 1.9.0
*/
@Target(ElementType.TYPE)

View File

@@ -15,7 +15,7 @@
*
*/
package org.springframework.data.gemfire.mapping;
package org.springframework.data.gemfire.mapping.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -27,6 +27,8 @@ import java.lang.annotation.Target;
import org.apache.geode.cache.query.Index;
import org.springframework.core.annotation.AliasFor;
import org.springframework.data.gemfire.IndexType;
import org.springframework.data.gemfire.mapping.GemfirePersistentEntity;
import org.springframework.data.gemfire.mapping.GemfirePersistentProperty;
/**
* The {@link Indexed} annotation is used to index a {@link GemfirePersistentEntity} {@link GemfirePersistentProperty},

View File

@@ -15,7 +15,7 @@
*
*/
package org.springframework.data.gemfire.mapping;
package org.springframework.data.gemfire.mapping.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
@@ -31,7 +31,7 @@ import org.springframework.core.annotation.AliasFor;
* {@link Annotation} defining the Local {@link Region} in which the application persistent entity will be stored.
*
* @author John Blum
* @see org.springframework.data.gemfire.mapping.Region
* @see Region
* @since 1.9.0
*/
@Target(ElementType.TYPE)

View File

@@ -15,7 +15,7 @@
*
*/
package org.springframework.data.gemfire.mapping;
package org.springframework.data.gemfire.mapping.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
@@ -31,7 +31,7 @@ import org.springframework.core.annotation.AliasFor;
* {@link Annotation} defining the Partition {@link Region} in which the application persistent entity will be stored.
*
* @author John Blum
* @see org.springframework.data.gemfire.mapping.Region
* @see Region
* @since 1.9.0
*/
@Target(ElementType.TYPE)

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012 the original author or authors.
* Copyright 2016 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.
@@ -12,9 +12,10 @@
* 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.gemfire.mapping;
package org.springframework.data.gemfire.mapping.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;

View File

@@ -15,7 +15,7 @@
*
*/
package org.springframework.data.gemfire.mapping;
package org.springframework.data.gemfire.mapping.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
@@ -32,7 +32,7 @@ import org.springframework.data.gemfire.ScopeType;
* {@link Annotation} defining the Replicate {@link Region} in which the application persistent entity will be stored.
*
* @author John Blum
* @see org.springframework.data.gemfire.mapping.Region
* @see Region
* @since 1.9.0
*/
@Target(ElementType.TYPE)

View File

@@ -24,7 +24,7 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.data.gemfire.mapping.GemfireMappingContext;
import org.springframework.data.gemfire.mapping.Region;
import org.springframework.data.gemfire.mapping.annotation.Region;
import org.springframework.data.gemfire.repository.GemfireRepository;
import org.springframework.data.gemfire.repository.support.GemfireRepositoryFactoryBean;
import org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource;

View File

@@ -126,8 +126,8 @@ public class GemfireRepositoryFactory extends RepositoryFactorySupport {
}
String getRepositoryRegionName(Class<?> repositoryInterface) {
return (repositoryInterface.isAnnotationPresent(org.springframework.data.gemfire.mapping.Region.class) ?
repositoryInterface.getAnnotation(org.springframework.data.gemfire.mapping.Region.class).value() : null);
return (repositoryInterface.isAnnotationPresent(org.springframework.data.gemfire.mapping.annotation.Region.class) ?
repositoryInterface.getAnnotation(org.springframework.data.gemfire.mapping.annotation.Region.class).value() : null);
}
/*