[FIX] corrent the search of primary key to support Morphia

This commit is contained in:
Edouard DUPIN 2025-01-02 23:01:13 +01:00
parent 645c8b1364
commit b581702df4

View File

@ -351,7 +351,10 @@ public class AnnotationTools {
}
public static boolean isIdField(final Field element) {
return element.getDeclaredAnnotationsByType(Id.class).length != 0;
if (element.getDeclaredAnnotationsByType(Id.class).length != 0) {
return true;
}
return element.getDeclaredAnnotationsByType(dev.morphia.annotations.Id.class).length != 0;
}
// Note: delete field can not be renamed with OptionRenameColumn