SGF-106 - Add annotation support for creating Indexes.
(cherry picked from commit ef5dd8b7ce)
Signed-off-by: John Blum <jblum@pivotal.io>
This commit is contained in:
@@ -36,9 +36,12 @@ import org.springframework.core.annotation.AliasFor;
|
||||
*
|
||||
* @author John Blum
|
||||
* @see org.springframework.context.annotation.ComponentScan
|
||||
* @see org.springframework.context.annotation.ComponentScan.Filter
|
||||
* @see org.springframework.context.annotation.Import
|
||||
* @see org.springframework.core.annotation.AliasFor
|
||||
* @see org.springframework.data.gemfire.config.annotation.EnableIndexes
|
||||
* @see org.springframework.data.gemfire.config.annotation.EntityDefinedRegionsConfiguration
|
||||
* @see org.springframework.data.gemfire.config.annotation.IndexConfiguration
|
||||
* @see org.apache.geode.cache.Region
|
||||
* @since 1.9.0
|
||||
*/
|
||||
@@ -46,7 +49,7 @@ import org.springframework.core.annotation.AliasFor;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
@Documented
|
||||
@Import(EntityDefinedRegionsConfiguration.class)
|
||||
@Import(IndexConfiguration.class)
|
||||
@SuppressWarnings({ "unused" })
|
||||
public @interface EnableEntityDefinedRegions {
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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.
|
||||
* 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.gemfire.config.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.apache.geode.cache.query.Index;
|
||||
|
||||
/**
|
||||
* The {@link EnableIndexes} annotation marks a Spring {@link org.springframework.context.annotation.Configuration @Configuration}
|
||||
* annotated application class to enable the creation of GemFire/Geode Indexes based on application persistent entity
|
||||
* field/property annotations, such as the {@link @Id} and @Indexed annotations.
|
||||
*
|
||||
* @author John Blum
|
||||
* @see org.springframework.data.gemfire.config.annotation.IndexConfiguration
|
||||
* @see org.apache.geode.cache.query.Index
|
||||
* @since 1.9.0
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
@Documented
|
||||
@SuppressWarnings({ "unused" })
|
||||
public @interface EnableIndexes {
|
||||
|
||||
/**
|
||||
* Determines whether all GemFire/Geode {@link Index Indexes} will be defined before created.
|
||||
* If set to {@literal true}, then all {@link Index Indexes} are defined first and the created
|
||||
* in a single, bulk operation, thereby improving index creation efficiency.
|
||||
*
|
||||
* Defaults to false.
|
||||
*/
|
||||
boolean define() default false;
|
||||
|
||||
}
|
||||
@@ -75,10 +75,32 @@ import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* The EntityDefinedRegionsConfiguration class...
|
||||
* The {@link EntityDefinedRegionsConfiguration} class is Spring {@link ImportBeanDefinitionRegistrar} used in
|
||||
* the {@link EnableEntityDefinedRegions} annotation to dynamically create GemFire/Geode {@link Region Regions}
|
||||
* based on the application persistent entity classes.
|
||||
*
|
||||
* @author John Blum
|
||||
* @since 1.0.0
|
||||
* @see org.springframework.beans.factory.BeanClassLoaderAware
|
||||
* @see org.springframework.beans.factory.BeanFactory
|
||||
* @see org.springframework.beans.factory.BeanFactoryAware
|
||||
* @see org.springframework.beans.factory.config.BeanDefinition
|
||||
* @see org.springframework.beans.factory.support.BeanDefinitionBuilder
|
||||
* @see org.springframework.beans.factory.support.BeanDefinitionRegistry
|
||||
* @see org.springframework.context.annotation.ImportBeanDefinitionRegistrar
|
||||
* @see org.springframework.data.gemfire.LocalRegionFactoryBean
|
||||
* @see org.springframework.data.gemfire.PartitionedRegionFactoryBean
|
||||
* @see org.springframework.data.gemfire.ReplicatedRegionFactoryBean
|
||||
* @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 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
|
||||
* @since 1.9.0
|
||||
*/
|
||||
public class EntityDefinedRegionsConfiguration
|
||||
implements BeanClassLoaderAware, BeanFactoryAware, ImportBeanDefinitionRegistrar {
|
||||
@@ -154,6 +176,7 @@ public class EntityDefinedRegionsConfiguration
|
||||
}
|
||||
|
||||
/* (non-Javadoc) */
|
||||
@SuppressWarnings("unused")
|
||||
protected ClassLoader getBeanClassLoader() {
|
||||
return this.beanClassLoader;
|
||||
}
|
||||
@@ -228,7 +251,7 @@ public class EntityDefinedRegionsConfiguration
|
||||
GemfirePersistentEntity persistentEntity = getPersistentEntity(persistentEntityClass);
|
||||
|
||||
registerRegionBeanDefinition(persistentEntity, strict, registry);
|
||||
postProcess(persistentEntity);
|
||||
postProcess(importingClassMetadata, registry, persistentEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -593,11 +616,17 @@ public class EntityDefinedRegionsConfiguration
|
||||
* Performs addition post processing on the {@link GemfirePersistentEntity} to offer additional feature support
|
||||
* (e.g. dynamic Index creation).
|
||||
*
|
||||
* @param importingClassMetadata {@link AnnotationMetadata} for the importing application class.
|
||||
* @param registry {@link BeanDefinitionRegistry} used to register Spring bean definitions.
|
||||
* @param persistentEntity {@link GemfirePersistentEntity} to process.
|
||||
* @return the given {@link GemfirePersistentEntity}.
|
||||
* @see org.springframework.beans.factory.support.BeanDefinitionRegistry
|
||||
* @see org.springframework.core.type.AnnotationMetadata
|
||||
* @see org.springframework.data.gemfire.mapping.GemfirePersistentEntity
|
||||
*/
|
||||
protected GemfirePersistentEntity<?> postProcess(GemfirePersistentEntity<?> persistentEntity) {
|
||||
protected GemfirePersistentEntity<?> postProcess(AnnotationMetadata importingClassMetadata,
|
||||
BeanDefinitionRegistry registry, GemfirePersistentEntity<?> persistentEntity) {
|
||||
|
||||
return persistentEntity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
/*
|
||||
* 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.
|
||||
* 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.gemfire.config.annotation;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
import org.apache.geode.cache.Region;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.core.annotation.AnnotationAttributes;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.gemfire.IndexFactoryBean;
|
||||
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.mapping.PropertyHandler;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* The {@link IndexConfiguration} class is a Spring {@link org.springframework.context.annotation.ImportBeanDefinitionRegistrar}
|
||||
* and extension of {@link EntityDefinedRegionsConfiguration} used in the {@link EnableIndexes} annotation
|
||||
* to dynamically create GemFire/Geode {@link org.apache.geode.cache.Region} Indexes based on
|
||||
* {@link GemfirePersistentEntity} {@link GemfirePersistentProperty} annotations.
|
||||
*
|
||||
* @author John Blum
|
||||
* @see java.lang.annotation.Annotation
|
||||
* @see org.springframework.beans.factory.support.BeanDefinitionBuilder
|
||||
* @see org.springframework.beans.factory.support.BeanDefinitionRegistry
|
||||
* @see org.springframework.data.annotation.Id
|
||||
* @see org.springframework.data.gemfire.IndexFactoryBean
|
||||
* @see org.springframework.data.gemfire.IndexType
|
||||
* @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 org.apache.geode.cache.Region
|
||||
* @see org.apache.geode.cache.query.Index
|
||||
* @since 1.9.0
|
||||
*/
|
||||
public class IndexConfiguration extends EntityDefinedRegionsConfiguration {
|
||||
|
||||
/**
|
||||
* Returns the {@link Annotation} {@link Class type} that configures and creates {@link Region} Indexes
|
||||
* from application persistent entity properties.
|
||||
*
|
||||
* @return the {@link Annotation} {@link Class type} that configures and creates {@link Region Region} Indexes
|
||||
* from application persistent entity properties.
|
||||
* @see org.springframework.data.gemfire.config.annotation.EnableIndexes
|
||||
* @see java.lang.annotation.Annotation
|
||||
* @see java.lang.Class
|
||||
*/
|
||||
protected Class<? extends Annotation> getEnableIndexesAnnotationType() {
|
||||
return EnableIndexes.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the {@link Annotation} {@link Class type} that configures and creates {@link Region} Indexes
|
||||
* from application persistent entity properties.
|
||||
*
|
||||
* @return the name of the {@link Annotation} {@link Class type} that configures and creates {@link Region Region}
|
||||
* Indexes from application persistent entity properties.
|
||||
* @see #getEnableIndexesAnnotationType()
|
||||
* @see java.lang.Class#getName()
|
||||
*/
|
||||
protected String getEnableIndexesAnnotationTypeName() {
|
||||
return getEnableIndexesAnnotationType().getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the simple name of the {@link Annotation} {@link Class type} that configures and creates {@link Region}
|
||||
* Indexes from application persistent entity properties.
|
||||
*
|
||||
* @return the simple name of the {@link Annotation} {@link Class type} that configures and creates
|
||||
* {@link Region Region} Indexes from application persistent entity properties.
|
||||
* @see #getEnableIndexesAnnotationType()
|
||||
* @see java.lang.Class#getSimpleName()
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
protected String getEnableIndexesAnnotationTypeSimpleName() {
|
||||
return getEnableIndexesAnnotationType().getSimpleName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
protected GemfirePersistentEntity<?> postProcess(AnnotationMetadata importingClassMetadata,
|
||||
final BeanDefinitionRegistry registry, GemfirePersistentEntity<?> persistentEntity) {
|
||||
|
||||
final GemfirePersistentEntity<?> localPersistentEntity =
|
||||
super.postProcess(importingClassMetadata, registry, persistentEntity);
|
||||
|
||||
if (isAnnotationPresent(importingClassMetadata, getEnableIndexesAnnotationTypeName())) {
|
||||
final AnnotationAttributes enableIndexesAttributes =
|
||||
getAnnotationAttributes(importingClassMetadata, getEnableIndexesAnnotationTypeName());
|
||||
|
||||
localPersistentEntity.doWithProperties(new PropertyHandler<GemfirePersistentProperty>() {
|
||||
@Override
|
||||
public void doWithPersistentProperty(GemfirePersistentProperty persistentProperty) {
|
||||
Id idAnnotation = persistentProperty.findAnnotation(Id.class);
|
||||
|
||||
if (idAnnotation != null) {
|
||||
registerIndexBeanDefinition(enableIndexesAttributes, localPersistentEntity, persistentProperty,
|
||||
IndexType.KEY, idAnnotation, registry);
|
||||
}
|
||||
|
||||
Indexed indexedAnnotation = persistentProperty.findAnnotation(Indexed.class);
|
||||
|
||||
if (indexedAnnotation != null) {
|
||||
registerIndexBeanDefinition(enableIndexesAttributes, localPersistentEntity, persistentProperty,
|
||||
indexedAnnotation.type(), indexedAnnotation, registry);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return persistentEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers an Index of the given {@link IndexType} for the {@link GemfirePersistentProperty}
|
||||
* on the {@link GemfirePersistentEntity} using the {@link Annotation} meta-data to define the Index.
|
||||
*
|
||||
* @param enableIndexesAttributes {@link AnnotationAttributes} containing meta-data
|
||||
* for the {@link EnableIndexes} annotation.
|
||||
* @param persistentEntity {@link GemfirePersistentEntity} containing the {@link GemfirePersistentProperty}
|
||||
* to be indexed.
|
||||
* @param persistentProperty {@link GemfirePersistentProperty} for which the Index will be created.
|
||||
* @param indexType {@link IndexType} enum specifying the Index type (e.g. KEY, HASH, etc).
|
||||
* @param indexAnnotation Index {@link Annotation}.
|
||||
* @param registry {@link BeanDefinitionRegistry} used to register the Index bean definition.
|
||||
* @see java.lang.annotation.Annotation
|
||||
* @see org.springframework.beans.factory.support.BeanDefinitionBuilder
|
||||
* @see org.springframework.beans.factory.support.BeanDefinitionRegistry
|
||||
* @see org.springframework.data.gemfire.IndexType
|
||||
* @see org.springframework.data.gemfire.mapping.GemfirePersistentEntity
|
||||
* @see org.springframework.data.gemfire.mapping.GemfirePersistentProperty
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
protected void registerIndexBeanDefinition(AnnotationAttributes enableIndexesAttributes,
|
||||
GemfirePersistentEntity<?> persistentEntity, GemfirePersistentProperty persistentProperty,
|
||||
IndexType indexType, Annotation indexAnnotation, BeanDefinitionRegistry registry) {
|
||||
|
||||
if (indexAnnotation != null) {
|
||||
AnnotationAttributes indexAnnotationAttributes = AnnotationAttributes.fromMap(
|
||||
AnnotationUtils.getAnnotationAttributes(indexAnnotation));
|
||||
|
||||
BeanDefinitionBuilder indexFactoryBeanBuilder =
|
||||
BeanDefinitionBuilder.genericBeanDefinition(IndexFactoryBean.class);
|
||||
|
||||
String indexName = resolveName(persistentEntity, persistentProperty,
|
||||
indexAnnotationAttributes, indexType);
|
||||
|
||||
indexFactoryBeanBuilder.addPropertyReference("cache", GemfireConstants.DEFAULT_GEMFIRE_CACHE_NAME);
|
||||
|
||||
indexFactoryBeanBuilder.addPropertyValue("define", resolveDefine(enableIndexesAttributes));
|
||||
|
||||
indexFactoryBeanBuilder.addPropertyValue("expression",
|
||||
resolveExpression(persistentEntity, persistentProperty, indexAnnotationAttributes));
|
||||
|
||||
indexFactoryBeanBuilder.addPropertyValue("from",
|
||||
resolveFrom(persistentEntity, persistentProperty, indexAnnotationAttributes));
|
||||
|
||||
indexFactoryBeanBuilder.addPropertyValue("name", indexName);
|
||||
|
||||
indexFactoryBeanBuilder.addPropertyValue("type",
|
||||
resolveType(persistentEntity, persistentProperty, indexAnnotationAttributes, indexType).toString());
|
||||
|
||||
registry.registerBeanDefinition(indexName, indexFactoryBeanBuilder.getBeanDefinition());
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc) */
|
||||
private boolean resolveDefine(AnnotationAttributes enableIndexesAnnotationAttributes) {
|
||||
return (enableIndexesAnnotationAttributes.containsKey("define")
|
||||
&& enableIndexesAnnotationAttributes.getBoolean("define"));
|
||||
}
|
||||
|
||||
/* (non-Javadoc) */
|
||||
@SuppressWarnings("unused")
|
||||
private String resolveExpression(GemfirePersistentEntity<?> persistentEntity,
|
||||
GemfirePersistentProperty persistentProperty, AnnotationAttributes indexAnnotationAttributes) {
|
||||
|
||||
String expression = (indexAnnotationAttributes.containsKey("expression")
|
||||
? indexAnnotationAttributes.getString("expression") : null);
|
||||
|
||||
return (StringUtils.hasText(expression) ? expression : persistentProperty.getName());
|
||||
}
|
||||
|
||||
/* (non-Javadoc) */
|
||||
@SuppressWarnings("unused")
|
||||
private String resolveFrom(GemfirePersistentEntity<?> persistentEntity,
|
||||
GemfirePersistentProperty persistentProperty, AnnotationAttributes indexAnnotationAttributes) {
|
||||
|
||||
String from = (indexAnnotationAttributes.containsKey("from")
|
||||
? indexAnnotationAttributes.getString("from") : null);
|
||||
|
||||
return (StringUtils.hasText(from) ? from : persistentEntity.getRegionName());
|
||||
}
|
||||
|
||||
/* (non-Javadoc) */
|
||||
private String resolveName(GemfirePersistentEntity<?> persistentEntity,
|
||||
GemfirePersistentProperty persistentProperty, AnnotationAttributes indexAnnotationAttributes,
|
||||
IndexType indexType) {
|
||||
|
||||
String indexName = (indexAnnotationAttributes.containsKey("name")
|
||||
? indexAnnotationAttributes.getString("name") : null);
|
||||
|
||||
return (StringUtils.hasText(indexName) ? indexName
|
||||
: generateIndexName(persistentEntity, persistentProperty, indexType));
|
||||
}
|
||||
|
||||
/* (non-Javadoc) */
|
||||
private String generateIndexName(GemfirePersistentEntity persistentEntity,
|
||||
GemfirePersistentProperty persistentProperty, IndexType indexType) {
|
||||
|
||||
return String.format("%1$s%2$s%3$sIdx", persistentEntity.getRegionName(),
|
||||
StringUtils.capitalize(persistentProperty.getName()),
|
||||
StringUtils.capitalize(indexType.name().toLowerCase()));
|
||||
}
|
||||
|
||||
/* (non-Javadoc) */
|
||||
@SuppressWarnings("unused")
|
||||
private IndexType resolveType(GemfirePersistentEntity<?> persistentEntity,
|
||||
GemfirePersistentProperty persistentProperty, AnnotationAttributes indexAnnotationAttributes,
|
||||
IndexType indexType) {
|
||||
|
||||
IndexType resolvedIndexType = (indexAnnotationAttributes.containsKey("type")
|
||||
? indexAnnotationAttributes.getEnum("type") : null);
|
||||
|
||||
return (resolvedIndexType != null ? resolvedIndexType : indexType);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* 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.
|
||||
* 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.gemfire.mapping;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.apache.geode.cache.query.Index;
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
import org.springframework.data.gemfire.IndexType;
|
||||
|
||||
/**
|
||||
* The {@link Indexed} annotation is used to index a {@link GemfirePersistentEntity} {@link GemfirePersistentProperty},
|
||||
* which creates a GemFire/Geode {@link Index} on a GemFire/Geode {@link org.apache.geode.cache.Region}.
|
||||
*
|
||||
* @author John Blum
|
||||
* @see org.springframework.core.annotation.AliasFor
|
||||
* @see org.springframework.data.gemfire.IndexType
|
||||
* @see org.apache.geode.cache.Region
|
||||
* @see org.apache.geode.cache.query.Index
|
||||
* @since 1.9.0
|
||||
*/
|
||||
@Target({ ElementType.FIELD, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
@Documented
|
||||
@SuppressWarnings({ "unused" })
|
||||
public @interface Indexed {
|
||||
|
||||
/**
|
||||
* Name of the Index.
|
||||
*/
|
||||
@AliasFor(attribute = "name")
|
||||
String value() default "";
|
||||
|
||||
/**
|
||||
* Name of the Index.
|
||||
*/
|
||||
@AliasFor(attribute = "value")
|
||||
String name() default "";
|
||||
|
||||
/**
|
||||
* Expression to index.
|
||||
*/
|
||||
String expression() default "";
|
||||
|
||||
/**
|
||||
* The GemFire/Geode {@link org.apache.geode.cache.Region} on which the Index is created.
|
||||
*/
|
||||
String from() default "";
|
||||
|
||||
/**
|
||||
* Type of Index to create.
|
||||
*
|
||||
* Defaults to {@link IndexType#HASH}.
|
||||
*/
|
||||
IndexType type() default IndexType.HASH;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user