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