DATACOUCH-542 - support @Field to supply a different name for a field

This commit is contained in:
mikereiche
2020-06-03 12:20:26 -07:00
parent 25e44bae87
commit dafff211a4
2 changed files with 64 additions and 0 deletions

View File

@@ -73,6 +73,11 @@ public class BasicCouchbasePersistentProperty extends AnnotationBasedPersistentP
*/
@Override
public String getFieldName() {
Field annotationField = getField().getAnnotation(Field.class);
if (annotationField != null && StringUtils.hasText(annotationField.value())) {
return annotationField.value();
}
JsonProperty annotation = getField().getAnnotation(JsonProperty.class);
if (annotation != null && StringUtils.hasText(annotation.value())) {