@@ -307,7 +307,7 @@ protected <S> S read(TypeInformation<S> type, RowDocument source) {
307307 * @return the converted object, will never be {@literal null}.
308308 */
309309 protected <S > S readAggregate (ConversionContext context , RowDocument document ,
310- TypeInformation <? extends S > typeHint ) {
310+ TypeInformation <? extends S > typeHint ) {
311311 return readAggregate (context , new RowDocumentAccessor (document ), typeHint );
312312 }
313313
@@ -321,7 +321,7 @@ protected <S> S readAggregate(ConversionContext context, RowDocument document,
321321 */
322322 @ SuppressWarnings ("unchecked" )
323323 protected <S > S readAggregate (ConversionContext context , RowDocumentAccessor documentAccessor ,
324- TypeInformation <? extends S > typeHint ) {
324+ TypeInformation <? extends S > typeHint ) {
325325
326326 Class <? extends S > rawType = typeHint .getType ();
327327
@@ -430,8 +430,7 @@ private <T> T doConvert(Object value, Class<? extends T> target) {
430430 }
431431
432432 @ SuppressWarnings ("ConstantConditions" )
433- private <T > T doConvert (Object value , Class <? extends T > target ,
434- @ Nullable Class <? extends T > fallback ) {
433+ private <T > T doConvert (Object value , Class <? extends T > target , @ Nullable Class <? extends T > fallback ) {
435434
436435 if (getConversionService ().canConvert (value .getClass (), target ) || fallback == null ) {
437436 return getConversionService ().convert (value , target );
@@ -504,7 +503,7 @@ public RelationalPropertyValueProvider withContext(ConversionContext context) {
504503 entity , contextualizing , context .getPath ().getCurrentObject ());
505504
506505 return new ConverterAwareSpELExpressionParameterValueProvider (context , evaluator , getConversionService (),
507- new ConvertingParameterValueProvider <>( parameterProvider ::getParameterValue ));
506+ new ConvertingParameterValueProvider <>(parameterProvider ::getParameterValue ));
508507 }
509508
510509 private <S > S populateProperties (ConversionContext context , RelationalPersistentEntity <S > entity ,
@@ -641,6 +640,11 @@ private Object getPotentiallyConvertedSimpleWrite(Object value) {
641640 protected Object getPotentiallyConvertedSimpleRead (Object value , TypeInformation <?> type ) {
642641
643642 Class <?> target = type .getType ();
643+
644+ if (getConversions ().hasCustomReadTarget (value .getClass (), target )) {
645+ return getConversionService ().convert (value , TypeDescriptor .forObject (value ), createTypeDescriptor (type ));
646+ }
647+
644648 if (ClassUtils .isAssignableValue (target , value )) {
645649 return value ;
646650 }
@@ -787,8 +791,7 @@ protected DefaultConversionContext(RelationalConverter sourceConverter,
787791
788792 @ SuppressWarnings ("unchecked" )
789793 @ Override
790- public <S > S convert (Object source , TypeInformation <? extends S > typeHint ,
791- ConversionContext context ) {
794+ public <S > S convert (Object source , TypeInformation <? extends S > typeHint , ConversionContext context ) {
792795
793796 Assert .notNull (source , "Source must not be null" );
794797 Assert .notNull (typeHint , "TypeInformation must not be null" );
@@ -1196,7 +1199,8 @@ protected <T> T potentiallyConvertSpelValue(Object object, Parameter<T, Relation
11961199 }
11971200 }
11981201
1199- private record PropertyTranslatingPropertyAccessor <T > (PersistentPropertyAccessor <T > delegate ,
1202+ private record PropertyTranslatingPropertyAccessor <T >(
1203+ PersistentPropertyAccessor <T > delegate ,
12001204 PersistentPropertyTranslator propertyTranslator ) implements PersistentPropertyAccessor <T > {
12011205
12021206 static <T > PersistentPropertyAccessor <T > create (PersistentPropertyAccessor <T > delegate ,
0 commit comments