@@ -307,7 +307,7 @@ protected <S> S read(TypeInformation<S> type, RowDocument source) {
307
307
* @return the converted object, will never be {@literal null}.
308
308
*/
309
309
protected <S > S readAggregate (ConversionContext context , RowDocument document ,
310
- TypeInformation <? extends S > typeHint ) {
310
+ TypeInformation <? extends S > typeHint ) {
311
311
return readAggregate (context , new RowDocumentAccessor (document ), typeHint );
312
312
}
313
313
@@ -321,7 +321,7 @@ protected <S> S readAggregate(ConversionContext context, RowDocument document,
321
321
*/
322
322
@ SuppressWarnings ("unchecked" )
323
323
protected <S > S readAggregate (ConversionContext context , RowDocumentAccessor documentAccessor ,
324
- TypeInformation <? extends S > typeHint ) {
324
+ TypeInformation <? extends S > typeHint ) {
325
325
326
326
Class <? extends S > rawType = typeHint .getType ();
327
327
@@ -430,8 +430,7 @@ private <T> T doConvert(Object value, Class<? extends T> target) {
430
430
}
431
431
432
432
@ 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 ) {
435
434
436
435
if (getConversionService ().canConvert (value .getClass (), target ) || fallback == null ) {
437
436
return getConversionService ().convert (value , target );
@@ -504,7 +503,7 @@ public RelationalPropertyValueProvider withContext(ConversionContext context) {
504
503
entity , contextualizing , context .getPath ().getCurrentObject ());
505
504
506
505
return new ConverterAwareSpELExpressionParameterValueProvider (context , evaluator , getConversionService (),
507
- new ConvertingParameterValueProvider <>( parameterProvider ::getParameterValue ));
506
+ new ConvertingParameterValueProvider <>(parameterProvider ::getParameterValue ));
508
507
}
509
508
510
509
private <S > S populateProperties (ConversionContext context , RelationalPersistentEntity <S > entity ,
@@ -641,6 +640,11 @@ private Object getPotentiallyConvertedSimpleWrite(Object value) {
641
640
protected Object getPotentiallyConvertedSimpleRead (Object value , TypeInformation <?> type ) {
642
641
643
642
Class <?> target = type .getType ();
643
+
644
+ if (getConversions ().hasCustomReadTarget (value .getClass (), target )) {
645
+ return doConvert (value , target );
646
+ }
647
+
644
648
if (ClassUtils .isAssignableValue (target , value )) {
645
649
return value ;
646
650
}
@@ -787,8 +791,7 @@ protected DefaultConversionContext(RelationalConverter sourceConverter,
787
791
788
792
@ SuppressWarnings ("unchecked" )
789
793
@ 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 ) {
792
795
793
796
Assert .notNull (source , "Source must not be null" );
794
797
Assert .notNull (typeHint , "TypeInformation must not be null" );
@@ -1196,7 +1199,8 @@ protected <T> T potentiallyConvertSpelValue(Object object, Parameter<T, Relation
1196
1199
}
1197
1200
}
1198
1201
1199
- private record PropertyTranslatingPropertyAccessor <T > (PersistentPropertyAccessor <T > delegate ,
1202
+ private record PropertyTranslatingPropertyAccessor <T >(
1203
+ PersistentPropertyAccessor <T > delegate ,
1200
1204
PersistentPropertyTranslator propertyTranslator ) implements PersistentPropertyAccessor <T > {
1201
1205
1202
1206
static <T > PersistentPropertyAccessor <T > create (PersistentPropertyAccessor <T > delegate ,
0 commit comments