DATACMNS-444 - DefaultPersistentPropertyPath now skips null converted names.

If a Converter handed into DefaultPersistentPropertyPath.toDotPath(…) returns null or an empty string for a mapped property name, that value is skipped during path construction.
This commit is contained in:
Oliver Gierke
2014-02-19 18:10:02 +01:00
parent f089acb17e
commit 4cee676608
2 changed files with 44 additions and 6 deletions

View File

@@ -93,10 +93,15 @@ class DefaultPersistentPropertyPath<T extends PersistentProperty<T>> implements
List<String> result = new ArrayList<String>();
for (T property : properties) {
result.add(converterToUse.convert(property));
String convert = converterToUse.convert(property);
if (StringUtils.hasText(convert)) {
result.add(convert);
}
}
return StringUtils.collectionToDelimitedString(result, delimiterToUse);
return result.isEmpty() ? null : StringUtils.collectionToDelimitedString(result, delimiterToUse);
}
/*