Class MappingUtils
java.lang.Object
org.springframework.data.aerospike.core.MappingUtils
A utility class providing methods for entity mapping and persistence operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String[]getBinNamesFromTargetClass(Class<?> targetClass, MappingContext<BasicAerospikePersistentEntity<?>, AerospikePersistentProperty> mappingContext) Retrieves an array of bin names for a given target class based on its persistent properties.static String[]getBinNamesFromTargetClassOrNull(Class<?> entityClass, Class<?> targetClass, MappingContext<BasicAerospikePersistentEntity<?>, AerospikePersistentProperty> mappingContext) Retrieves an array of bin names from target class, if it is specified and differs from the given entity class, otherwise returnsnull.getBinNamesListFromTargetClass(Class<?> targetClass, MappingContext<BasicAerospikePersistentEntity<?>, AerospikePersistentProperty> mappingContext) Retrieves a list of bin names for a given target class based on its persistent properties.
-
Method Details
-
getBinNamesFromTargetClassOrNull
public static String[] getBinNamesFromTargetClassOrNull(@Nullable Class<?> entityClass, @Nullable Class<?> targetClass, MappingContext<BasicAerospikePersistentEntity<?>, AerospikePersistentProperty> mappingContext) Retrieves an array of bin names from target class, if it is specified and differs from the given entity class, otherwise returnsnull.- Parameters:
entityClass- The primary class of the entity. Can benulltargetClass- An optional alternative target class. Can benullmappingContext- The mapping context used to retrieve persistent entity information- Returns:
- An array of bin names from the target class, or
nullif no distinct target class is used
-
getBinNamesFromTargetClass
public static String[] getBinNamesFromTargetClass(Class<?> targetClass, MappingContext<BasicAerospikePersistentEntity<?>, AerospikePersistentProperty> mappingContext) Retrieves an array of bin names for a given target class based on its persistent properties. This method iterates through the properties of the target entity and collects their field names, excluding the ID property.- Parameters:
targetClass- The class for which to retrieve bin namesmappingContext- The mapping context used to retrieve persistent entity information- Returns:
- An array of strings representing the bin names associated with the target class's properties
-
getBinNamesListFromTargetClass
public static List<String> getBinNamesListFromTargetClass(Class<?> targetClass, MappingContext<BasicAerospikePersistentEntity<?>, AerospikePersistentProperty> mappingContext) Retrieves a list of bin names for a given target class based on its persistent properties. This method iterates through the properties of the target entity and collects their field names, excluding the ID property.- Parameters:
targetClass- The class for which to retrieve bin namesmappingContext- The mapping context used to retrieve persistent entity information- Returns:
- A list of strings representing the bin names associated with the target class's properties
-