30
30
import java .util .stream .Collectors ;
31
31
32
32
import org .springframework .core .annotation .AnnotatedElementUtils ;
33
+ import org .springframework .core .env .PropertyResolver ;
33
34
import org .springframework .data .annotation .Immutable ;
34
35
import org .springframework .data .annotation .TypeAlias ;
35
36
import org .springframework .data .domain .Persistable ;
58
59
* @author Thomas Darimont
59
60
* @author Christoph Strobl
60
61
* @author Mark Paluch
62
+ * @author Tim Sazon
61
63
*/
62
64
public class BasicPersistentEntity <T , P extends PersistentProperty <P >> implements MutablePersistentEntity <T , P > {
63
65
@@ -78,6 +80,7 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
78
80
private @ Nullable P versionProperty ;
79
81
private PersistentPropertyAccessorFactory propertyAccessorFactory ;
80
82
private EvaluationContextProvider evaluationContextProvider = EvaluationContextProvider .DEFAULT ;
83
+ private @ Nullable PropertyResolver propertyResolver ;
81
84
82
85
private final Lazy <Alias > typeAlias ;
83
86
private final Lazy <IsNewStrategy > isNewStrategy ;
@@ -254,6 +257,15 @@ public void setEvaluationContextProvider(EvaluationContextProvider provider) {
254
257
this .evaluationContextProvider = provider ;
255
258
}
256
259
260
+ /*
261
+ * (non-Javadoc)
262
+ * @see org.springframework.data.mapping.model.MutablePersistentEntity#setPropertyResolver(org.springframework.core.env.PropertyResolver)
263
+ */
264
+ @ Override
265
+ public void setPropertyResolver (@ Nullable PropertyResolver propertyResolver ) {
266
+ this .propertyResolver = propertyResolver ;
267
+ }
268
+
257
269
/**
258
270
* Returns the given property if it is a better candidate for the id property than the current id property.
259
271
*
@@ -561,6 +573,14 @@ protected EvaluationContext getEvaluationContext(Object rootObject, ExpressionDe
561
573
return evaluationContextProvider .getEvaluationContext (rootObject , dependencies );
562
574
}
563
575
576
+ /**
577
+ * Returns the {@link PropertyResolver}.
578
+ */
579
+ @ Nullable
580
+ protected PropertyResolver getPropertyResolver () {
581
+ return propertyResolver ;
582
+ }
583
+
564
584
/**
565
585
* Returns the default {@link IsNewStrategy} to be used. Will be a {@link PersistentEntityIsNewStrategy} by default.
566
586
* Note, that this strategy only gets used if the entity doesn't implement {@link Persistable} as this indicates the
0 commit comments