/** * Maps the property name while retaining potential positional operator {@literal $}. * * @param property * @return */ protected String mapPropertyName(MongoPersistentProperty property) { StringBuilder mappedName = new StringBuilder(PropertyToFieldNameConverter.INSTANCE.convert(property)); boolean inspect = iterator.hasNext(); while (inspect) { String partial = iterator.next(); boolean isPositional = (isPositionalParameter(partial) && (property.isMap() || property.isCollectionLike())); if (isPositional) { mappedName.append(".").append(partial); } inspect = isPositional && iterator.hasNext(); } return mappedName.toString(); }
/** * Maps the property name while retaining potential positional operator {@literal $}. * * @param property * @return */ protected String mapPropertyName(MongoPersistentProperty property) { StringBuilder mappedName = new StringBuilder(PropertyToFieldNameConverter.INSTANCE.convert(property)); boolean inspect = iterator.hasNext(); while (inspect) { String partial = iterator.next(); boolean isPositional = (isPositionalParameter(partial) && (property.isMap() || property.isCollectionLike())); if (isPositional) { mappedName.append(".").append(partial); } inspect = isPositional && iterator.hasNext(); } return mappedName.toString(); }
public PositionParameterRetainingPropertyKeyConverter(String rawKey) { this.keyMapper = new KeyMapper(rawKey); }
@Override public String convert(MongoPersistentProperty source) { return super.convert(source) == null ? null : mapper.mapPropertyName(source); } }
/** * Creates a new {@link AssociationConverter} for the given {@link Association}. * * @param association must not be {@literal null}. */ public UpdateAssociationConverter(Association<MongoPersistentProperty> association, String key) { super(association); this.mapper = new KeyMapper(key); }
@Override public String convert(MongoPersistentProperty source) { return keyMapper.mapPropertyName(source); } }
public PositionParameterRetainingPropertyKeyConverter(String rawKey) { this.keyMapper = new KeyMapper(rawKey); }
/** * Creates a new {@link AssociationConverter} for the given {@link Association}. * * @param association must not be {@literal null}. */ public UpdateAssociationConverter(Association<MongoPersistentProperty> association, String key) { super(association); this.mapper = new KeyMapper(key); }
@Override public String convert(MongoPersistentProperty source) { return super.convert(source) == null ? null : mapper.mapPropertyName(source); } }
@Override public String convert(MongoPersistentProperty source) { return keyMapper.mapPropertyName(source); } }