DATACOUCH-604 - Fix NullPointerException when identifying Id fields. Handle @Field.

This commit is contained in:
mikereiche
2020-09-16 13:40:54 -07:00
parent e9add0c90c
commit ae43ed9949

View File

@@ -27,6 +27,8 @@ import org.springframework.util.StringUtils;
import com.couchbase.client.core.deps.com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Locale;
/**
* Implements annotated property representations of a given {@link Field} instance.
* <p/>
@@ -100,7 +102,7 @@ public class BasicCouchbasePersistentProperty extends AnnotationBasedPersistentP
return true;
}
// is field named "id"
if(getName().equals("id")){
if(getField() != null && this.getFieldName().toLowerCase(Locale.ROOT).equals("id")){
return true;
}
return false;