Fix: 'No ScalarType registered for class java.util.GregorianCalendar' - check all registered scalar type if no exact match was found

This commit is contained in:
Roland Praml
2021-12-02 08:30:24 +01:00
parent d934d44164
commit 483f0398b2
@@ -43,6 +43,7 @@ import java.sql.Timestamp;
import java.sql.Types;
import java.time.*;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
/**
@@ -281,8 +282,11 @@ public final class DefaultTypeManager implements TypeManager {
}
private ScalarType<?> checkInterfaceTypes(Class<?> type) {
if (java.nio.file.Path.class.isAssignableFrom(type)) {
return typeMap.get(java.nio.file.Path.class);
for (Entry<Class<?>, ScalarType<?>> entry : typeMap.entrySet()) {
if (entry.getKey().isAssignableFrom(type)) {
typeMap.put(type, entry.getValue());
return entry.getValue();
}
}
return null;
}