SGF-605 - Add override attribute defaulted to false in the @Indexed annotation.

(cherry picked from commit 007cd25608083264e5796f04f338b551b9fa84ad)
Signed-off-by: John Blum <jblum@pivotal.io>
This commit is contained in:
John Blum
2017-03-10 11:11:30 -08:00
parent 7562129080
commit 8e256815df
4 changed files with 86 additions and 10 deletions

View File

@@ -181,10 +181,8 @@ public class IndexConfiguration extends EntityDefinedRegionsConfiguration {
indexFactoryBeanBuilder.addPropertyValue("name", indexName);
/*
indexFactoryBeanBuilder.addPropertyValue("override",
resolveOverride(persistentEntity, persistentProperty, indexedAttributes));
*/
indexFactoryBeanBuilder.addPropertyValue("type",
resolveType(persistentEntity, persistentProperty, indexedAttributes, indexType).toString());
@@ -289,7 +287,6 @@ public class IndexConfiguration extends EntityDefinedRegionsConfiguration {
}
/* (non-Javadoc) */
/*
@SuppressWarnings("unused")
private boolean resolveOverride(GemfirePersistentEntity persistentEntity,
GemfirePersistentProperty persistentProperty, AnnotationAttributes indexedAttributes) {
@@ -297,7 +294,6 @@ public class IndexConfiguration extends EntityDefinedRegionsConfiguration {
return (indexedAttributes.containsKey("override")
&& indexedAttributes.getBoolean("override"));
}
*/
/* (non-Javadoc) */
@SuppressWarnings("unused")

View File

@@ -70,6 +70,13 @@ public @interface Indexed {
*/
String from() default "";
/**
* Determines whether this given {@link Index} definition should override any existing {@link Index} definition.
*
* Defaults to {@literal false}.
*/
boolean override() default false;
/**
* Type of Index to create.
*