@SuppressWarnings("deprecation") protected IndexDefinitionHolder createCompoundIndexDefinition(String dotPath, String collection, CompoundIndex index, MongoPersistentEntity<?> entity) { CompoundIndexDefinition indexDefinition = new CompoundIndexDefinition( resolveCompoundIndexKeyFromStringDefinition(dotPath, index.def())); if (!index.useGeneratedName()) { indexDefinition.named(pathAwareIndexName(index.name(), dotPath, null)); } if (index.unique()) { indexDefinition.unique(); } if (index.sparse()) { indexDefinition.sparse(); } if (index.background()) { indexDefinition.background(); } return new IndexDefinitionHolder(dotPath, indexDefinition, collection); }
@SuppressWarnings("deprecation") protected IndexDefinitionHolder createCompoundIndexDefinition(String dotPath, String collection, CompoundIndex index, MongoPersistentEntity<?> entity) { CompoundIndexDefinition indexDefinition = new CompoundIndexDefinition( resolveCompoundIndexKeyFromStringDefinition(dotPath, index.def())); if (!index.useGeneratedName()) { indexDefinition.named(pathAwareIndexName(index.name(), dotPath, null)); } if (index.unique()) { indexDefinition.unique(); } if (index.sparse()) { indexDefinition.sparse(); } if (index.background()) { indexDefinition.background(); } return new IndexDefinitionHolder(dotPath, indexDefinition, collection); }