I have a Postgres column with a UUID array, in the class
ResultSetGetterFactory {
factoryRegistry.put(UUID.class, new GetterFactory<ResultSet, JdbcColumnKey>() { ... }
}
the column type is mapped to JdbcColumnKey.UNDEFINED_TYPE, so the deserialization fails as the type is already a UUID object and UUIDUnspecifiedTypeGetter does not have that option in its switch case.
Interestingly in the same file below, we have this:
case Types.OTHER:
// assume it's a UUID postgres
return (Getter<ResultSet, P>) new ObjectResultSetGetter(key.getIndex());
But the JDBCColumn was never mapped to Types.OTHER
The exception:
java.lang.IllegalArgumentException: Cannot convert 79384f39-42f3-4dd8-995d-8580d59d72e2 to UUID
at org.simpleflatmapper.reflect.getter.UUIDUnspecifiedTypeGetter.get(UUIDUnspecifiedTypeGetter.java:29)
In my record class it properly marked as
public void setImages(UUID[] value) {
set(8, value);
}
public UUID[] getImages() {
return (UUID[]) get(8);
}
For now, I managed to work around it by adding a custom column property like this to the mapper (Kotlin syntax)
I have a Postgres column with a UUID array, in the class
the column type is mapped to JdbcColumnKey.UNDEFINED_TYPE, so the deserialization fails as the type is already a UUID object and UUIDUnspecifiedTypeGetter does not have that option in its switch case.
Interestingly in the same file below, we have this:
But the JDBCColumn was never mapped to Types.OTHER
The exception:
java.lang.IllegalArgumentException: Cannot convert 79384f39-42f3-4dd8-995d-8580d59d72e2 to UUID at org.simpleflatmapper.reflect.getter.UUIDUnspecifiedTypeGetter.get(UUIDUnspecifiedTypeGetter.java:29)
In my record class it properly marked as
For now, I managed to work around it by adding a custom column property like this to the mapper (Kotlin syntax)