Class PersistentPropertyTranslator
java.lang.Object
org.springframework.data.relational.core.mapping.PersistentPropertyTranslator
Utility to translate a
RelationalPersistentProperty
into a corresponding property from a different
RelationalPersistentEntity
by looking it up by name.
Mainly used within the framework.
- Since:
- 3.2
- Author:
- Mark Paluch
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PersistentPropertyTranslator
create
(RelationalPersistentEntity<?> targetEntity) Create a newPersistentPropertyTranslator
.static PersistentPropertyTranslator
create
(RelationalPersistentEntity<?> targetEntity, Predicate<RelationalPersistentProperty> translationFilter) Create a newPersistentPropertyTranslator
accepting afilter predicate
whether the translation should happen at all.translate
(RelationalPersistentProperty property) Translate aRelationalPersistentProperty
into a corresponding property from a differentRelationalPersistentEntity
.
-
Constructor Details
-
PersistentPropertyTranslator
public PersistentPropertyTranslator()
-
-
Method Details
-
translate
Translate aRelationalPersistentProperty
into a corresponding property from a differentRelationalPersistentEntity
.- Parameters:
property
- must not be null.- Returns:
- the translated property. Can be the original
property
.
-
create
public static PersistentPropertyTranslator create(@Nullable RelationalPersistentEntity<?> targetEntity) Create a newPersistentPropertyTranslator
.- Parameters:
targetEntity
- must not be null.- Returns:
- the property translator to use.
-
create
public static PersistentPropertyTranslator create(@Nullable RelationalPersistentEntity<?> targetEntity, Predicate<RelationalPersistentProperty> translationFilter) Create a newPersistentPropertyTranslator
accepting afilter predicate
whether the translation should happen at all.- Parameters:
targetEntity
- must not be null.translationFilter
- must not be null.- Returns:
- the property translator to use.
-