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 a989e710e6
commit bfa2c93720

View File

@@ -99,7 +99,13 @@ public class BasicCouchbasePersistentProperty extends AnnotationBasedPersistentP
// DATACOUCH-145: allows SDK's @Id annotation to be used
@Override
public boolean isIdProperty() {
return isAnnotationPresent(Id.class) || super.isIdProperty()
|| this.getFieldName().toLowerCase(Locale.ROOT).equals("id");
if (super.isIdProperty()){
return true;
}
// is field named "id"
if(getField() != null && this.getFieldName().toLowerCase(Locale.ROOT).equals("id")){
return true;
}
return false;
}
}