DATACOUCH-199 - Make automatic index creation opt-in

In addition to annotating the repository with xxxIndexed annotations, user must now opt-in to the feature by redefining the indexManager bean in the configuration. This is so production use of this feature is actively discouraged.
This commit is contained in:
Simon Baslé
2016-02-05 17:57:26 +01:00
parent 6d747e97f5
commit 0095313342
13 changed files with 95 additions and 29 deletions

View File

@@ -21,6 +21,7 @@ import org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration;
import org.springframework.data.couchbase.core.CouchbaseTemplate;
import org.springframework.data.couchbase.core.WriteResultChecking;
import org.springframework.data.couchbase.core.query.Consistency;
import org.springframework.data.couchbase.repository.support.IndexManager;
@Configuration
public class UnitTestApplicationConfig extends AbstractCouchbaseConfiguration {
@@ -75,6 +76,12 @@ public class UnitTestApplicationConfig extends AbstractCouchbaseConfiguration {
return template;
}
//this is for dev so it is ok to auto-create indexes
@Override
public IndexManager indexManager() {
return new IndexManager();
}
@Override
protected Consistency getDefaultConsistency() {
return Consistency.READ_YOUR_OWN_WRITES;