private void resolveAndAddIndexesForAssociation(Association<MongoPersistentProperty> association, List<IndexDefinitionHolder> indexes, String path, String collection) { MongoPersistentProperty property = association.getInverse(); String propertyDotPath = (StringUtils.hasText(path) ? path + "." : "") + property.getFieldName(); if (property.isAnnotationPresent(GeoSpatialIndexed.class) || property.isAnnotationPresent(TextIndexed.class)) { throw new MappingException( String.format("Cannot create geospatial-/text- index on DBRef in collection '%s' for path '%s'.", collection, propertyDotPath)); } IndexDefinitionHolder indexDefinitionHolder = createIndexDefinitionHolderForProperty(propertyDotPath, collection, property); if (indexDefinitionHolder != null) { indexes.add(indexDefinitionHolder); } }
private void guradAndPotentiallyAddIndexForProperty(MongoPersistentProperty persistentProperty, String dotPath, Path path, String collection, List<IndexDefinitionHolder> indexes, CycleGuard guard) { String propertyDotPath = (StringUtils.hasText(dotPath) ? dotPath + "." : "") + persistentProperty.getFieldName(); Path propertyPath = path.append(persistentProperty); guard.protect(persistentProperty, propertyPath); if (persistentProperty.isEntity()) { try { indexes.addAll(resolveIndexForClass(persistentProperty.getTypeInformation().getActualType(), propertyDotPath, propertyPath, collection, guard)); } catch (CyclicPropertyReferenceException e) { LOGGER.info(e.getMessage()); } } IndexDefinitionHolder indexDefinitionHolder = createIndexDefinitionHolderForProperty(propertyDotPath, collection, persistentProperty); if (indexDefinitionHolder != null) { indexes.add(indexDefinitionHolder); } }
private void potentiallyAddIndexForProperty(MongoPersistentEntity<?> root, MongoPersistentProperty persistentProperty, List<IndexDefinitionHolder> indexes, CycleGuard guard) { try { if (persistentProperty.isEntity()) { indexes.addAll(resolveIndexForClass(persistentProperty.getTypeInformation().getActualType(), persistentProperty.getFieldName(), Path.of(persistentProperty), root.getCollection(), guard)); } IndexDefinitionHolder indexDefinitionHolder = createIndexDefinitionHolderForProperty( persistentProperty.getFieldName(), root.getCollection(), persistentProperty); if (indexDefinitionHolder != null) { indexes.add(indexDefinitionHolder); } } catch (CyclicPropertyReferenceException e) { LOGGER.info(e.getMessage()); } }
private void resolveAndAddIndexesForAssociation(Association<MongoPersistentProperty> association, List<IndexDefinitionHolder> indexes, String path, String collection) { MongoPersistentProperty property = association.getInverse(); String propertyDotPath = (StringUtils.hasText(path) ? path + "." : "") + property.getFieldName(); if (property.isAnnotationPresent(GeoSpatialIndexed.class) || property.isAnnotationPresent(TextIndexed.class)) { throw new MappingException( String.format("Cannot create geospatial-/text- index on DBRef in collection '%s' for path '%s'.", collection, propertyDotPath)); } IndexDefinitionHolder indexDefinitionHolder = createIndexDefinitionHolderForProperty(propertyDotPath, collection, property); if (indexDefinitionHolder != null) { indexes.add(indexDefinitionHolder); } }
private void guradAndPotentiallyAddIndexForProperty(MongoPersistentProperty persistentProperty, String dotPath, Path path, String collection, List<IndexDefinitionHolder> indexes, CycleGuard guard) { String propertyDotPath = (StringUtils.hasText(dotPath) ? dotPath + "." : "") + persistentProperty.getFieldName(); Path propertyPath = path.append(persistentProperty); guard.protect(persistentProperty, propertyPath); if (persistentProperty.isEntity()) { try { indexes.addAll(resolveIndexForClass(persistentProperty.getTypeInformation().getActualType(), propertyDotPath, propertyPath, collection, guard)); } catch (CyclicPropertyReferenceException e) { LOGGER.info(e.getMessage()); } } IndexDefinitionHolder indexDefinitionHolder = createIndexDefinitionHolderForProperty(propertyDotPath, collection, persistentProperty); if (indexDefinitionHolder != null) { indexes.add(indexDefinitionHolder); } }
private void potentiallyAddIndexForProperty(MongoPersistentEntity<?> root, MongoPersistentProperty persistentProperty, List<IndexDefinitionHolder> indexes, CycleGuard guard) { try { if (persistentProperty.isEntity()) { indexes.addAll(resolveIndexForClass(persistentProperty.getTypeInformation().getActualType(), persistentProperty.getFieldName(), Path.of(persistentProperty), root.getCollection(), guard)); } IndexDefinitionHolder indexDefinitionHolder = createIndexDefinitionHolderForProperty( persistentProperty.getFieldName(), root.getCollection(), persistentProperty); if (indexDefinitionHolder != null) { indexes.add(indexDefinitionHolder); } } catch (CyclicPropertyReferenceException e) { LOGGER.info(e.getMessage()); } }