@@ -902,7 +902,7 @@ public RelationalConverter getSourceConverter() {
902
902
*
903
903
* @param <T>
904
904
*/
905
- interface ValueConverter <T > {
905
+ protected interface ValueConverter <T > {
906
906
907
907
Object convert (T source , TypeInformation <?> typeHint );
908
908
@@ -914,7 +914,7 @@ interface ValueConverter<T> {
914
914
*
915
915
* @param <T>
916
916
*/
917
- interface ContainerValueConverter <T > {
917
+ protected interface ContainerValueConverter <T > {
918
918
919
919
Object convert (ConversionContext context , T source , TypeInformation <?> typeHint );
920
920
@@ -923,7 +923,9 @@ interface ContainerValueConverter<T> {
923
923
}
924
924
925
925
/**
926
- * @since 3.4.3
926
+ * Projecting variant of {@link ConversionContext} applying mapping-metadata rules from the related entity.
927
+ *
928
+ * @since 3.2
927
929
*/
928
930
protected class ProjectingConversionContext extends DefaultConversionContext {
929
931
@@ -1017,10 +1019,19 @@ default ConversionContext forProperty(RelationalPersistentProperty property) {
1017
1019
*/
1018
1020
ConversionContext withPath (ObjectPath currentPath );
1019
1021
1022
+ /**
1023
+ * @return the current {@link ObjectPath}. Can be {@link ObjectPath#ROOT} for top-level contexts.
1024
+ */
1020
1025
ObjectPath getPath ();
1021
1026
1027
+ /**
1028
+ * @return the associated conversions.
1029
+ */
1022
1030
CustomConversions getCustomConversions ();
1023
1031
1032
+ /**
1033
+ * @return source {@link RelationalConverter}.
1034
+ */
1024
1035
RelationalConverter getSourceConverter ();
1025
1036
1026
1037
}
@@ -1106,6 +1117,7 @@ protected static final class DocumentValueProvider
1106
1117
private final RowDocumentAccessor accessor ;
1107
1118
private final ValueExpressionEvaluator evaluator ;
1108
1119
private final SpELContext spELContext ;
1120
+ private final RowDocument document ;
1109
1121
1110
1122
/**
1111
1123
* Creates a new {@link RelationalPropertyValueProvider} for the given source and {@link ValueExpressionEvaluator}.
@@ -1120,10 +1132,12 @@ private DocumentValueProvider(ConversionContext context, RowDocumentAccessor acc
1120
1132
Assert .notNull (context , "ConversionContext must no be null" );
1121
1133
Assert .notNull (accessor , "DocumentAccessor must no be null" );
1122
1134
Assert .notNull (evaluator , "ValueExpressionEvaluator must not be null" );
1135
+
1123
1136
this .context = context ;
1124
1137
this .accessor = accessor ;
1125
1138
this .evaluator = evaluator ;
1126
1139
this .spELContext = spELContext ;
1140
+ this .document = accessor .getDocument ();
1127
1141
}
1128
1142
1129
1143
@ Override
@@ -1152,7 +1166,7 @@ public boolean hasValue(RelationalPersistentProperty property) {
1152
1166
@ Override
1153
1167
public Object getValue (AggregatePath path ) {
1154
1168
1155
- Object value = accessor . getDocument () .get (path .getColumnInfo ().alias ().getReference ());
1169
+ Object value = document .get (path .getColumnInfo ().alias ().getReference ());
1156
1170
1157
1171
if (value == null ) {
1158
1172
return null ;
@@ -1163,27 +1177,19 @@ public Object getValue(AggregatePath path) {
1163
1177
1164
1178
@ Override
1165
1179
public boolean hasValue (AggregatePath path ) {
1166
- return accessor . getDocument () .get (path .getColumnInfo ().alias ().getReference ()) != null ;
1180
+ return document .get (path .getColumnInfo ().alias ().getReference ()) != null ;
1167
1181
}
1168
1182
1169
1183
@ Override
1170
1184
public boolean hasValue (SqlIdentifier identifier ) {
1171
- return accessor (). getDocument () .get (identifier .getReference ()) != null ;
1185
+ return document .get (identifier .getReference ()) != null ;
1172
1186
}
1173
1187
1174
1188
@ Override
1175
1189
public DocumentValueProvider withContext (ConversionContext context ) {
1176
1190
return context == this .context ? this : new DocumentValueProvider (context , accessor , evaluator , spELContext );
1177
1191
}
1178
1192
1179
- public ConversionContext context () {
1180
- return context ;
1181
- }
1182
-
1183
- public RowDocumentAccessor accessor () {
1184
- return accessor ;
1185
- }
1186
-
1187
1193
}
1188
1194
1189
1195
/**
0 commit comments