You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The detailed declaration of both UUID and String as target conversion types in IdentifierToPrimitivesConverter.getConvertibleTypes() causes problems in Spring Data's CustomConversions as it uses the pairs here to allow clients to detect the target type that will ultimately be handed into the convert(…) method.
This causes issues if the UUID type is returned first, as Identifiers using a sole String will try to be erroneously coerced into a UUID as reported here. Using String as the first value will always cause UUIDs to be rendered as String, even though a store might be able to persist UUIDs directly.
We should rather only return new ConvertiblePair(Identifier.class, Object.class) to delay the decision of which type to use to the actual conversion step.
The detailed declaration of both
UUID
andString
as target conversion types inIdentifierToPrimitivesConverter.getConvertibleTypes()
causes problems in Spring Data'sCustomConversions
as it uses the pairs here to allow clients to detect the target type that will ultimately be handed into theconvert(…)
method.This causes issues if the
UUID
type is returned first, asIdentifier
s using a soleString
will try to be erroneously coerced into a UUID as reported here. UsingString
as the first value will always causeUUID
s to be rendered asString
, even though a store might be able to persistUUID
s directly.We should rather only return
new ConvertiblePair(Identifier.class, Object.class)
to delay the decision of which type to use to the actual conversion step.Related tickets
Identifier
implementations to primitive fails with Spring Data JDBC spring-projects/spring-data-commons#3118The text was updated successfully, but these errors were encountered: