Package su.onno.spring
Class EnumUuidConverters.StringToRef
java.lang.Object
su.onno.spring.EnumUuidConverters.StringToRef
- All Implemented Interfaces:
org.springframework.core.convert.converter.GenericConverter
- Enclosing class:
EnumUuidConverters
@ReadingConverter
public static final class EnumUuidConverters.StringToRef
extends Object
implements org.springframework.core.convert.converter.GenericConverter
Reads a
Ref back from a varchar column that holds the referenced id as text.
The Ref → uuid column is the norm, but a column that pre-existed as varchar
(e.g. an attribute retyped from String to Ref<T>) hands the id back as a
String. This mirrors EnumUuidConverters.StringToEnum for the reference case so such legacy and
migrated columns round-trip instead of throwing.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.core.convert.converter.GenericConverter
org.springframework.core.convert.converter.GenericConverter.ConvertiblePair -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
StringToRef
public StringToRef()
-
-
Method Details
-
getConvertibleTypes
public Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> getConvertibleTypes()- Specified by:
getConvertibleTypesin interfaceorg.springframework.core.convert.converter.GenericConverter
-
convert
@Nullable public Object convert(@Nullable Object source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) - Specified by:
convertin interfaceorg.springframework.core.convert.converter.GenericConverter
-