Skip to content

Commit ae43ed9

Browse files
committed
DATACOUCH-604 - Fix NullPointerException when identifying Id fields. Handle @field.
1 parent e9add0c commit ae43ed9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/springframework/data/couchbase/core/mapping/BasicCouchbasePersistentProperty.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
import com.couchbase.client.core.deps.com.fasterxml.jackson.annotation.JsonProperty;
2929

30+
import java.util.Locale;
31+
3032
/**
3133
* Implements annotated property representations of a given {@link Field} instance.
3234
* <p/>
@@ -100,7 +102,7 @@ public boolean isIdProperty() {
100102
return true;
101103
}
102104
// is field named "id"
103-
if(getName().equals("id")){
105+
if(getField() != null && this.getFieldName().toLowerCase(Locale.ROOT).equals("id")){
104106
return true;
105107
}
106108
return false;

0 commit comments

Comments
 (0)