Class MapPropertyValueMapping
java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.AbstractMapping
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.InstancePropertyValueMapping
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.MapPropertyValueMapping
Maps singular MapPropertyValues between persistence and objects.
These cannot simply be serialized to JSON as that would impact the ability to search their values correctly, so we
must break apart the values and the types for each property:
{
...
:entityProperties/someProperty.json {:json "{\"class\":\"MapPropertyValue\",\"instancePropertyCategory\":\"MAP\",\"mapValues\":{\"class\":\"InstanceProperties\",\"instanceProperties\":{\"key\":\"{\"class\":\"PrimitivePropertyValue\",\"instancePropertyCategory\":\"PRIMITIVE\",\"primitiveDefCategory\":\"OM_PRIMITIVE_TYPE_STRING\",\"primitiveValue\":\"A Simple Term\"}\"}}}"}
:entityProperties/someProperty.value {"key": "A Simple Term"}
...
}
-
Field Summary
Fields inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.AbstractMapping
mapper, xtdbConnector
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic clojure.lang.IPersistentMap
addMapPropertyValueToDoc
(clojure.lang.IPersistentMap doc, clojure.lang.Keyword propertyKeyword, MapPropertyValue value) Add the provided map value to the XTDB map.static void
addMapPropertyValueToDoc
(XTDBOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument.Builder builder, PropertyKeywords keywords, MapPropertyValue value) Add the provided map value to the XTDB document.getMapPropertyValueForComparison
(XTDBOMRSRepositoryConnector xtdbConnector, MapPropertyValue mpv) Convert the provided map property value into a XTDB comparable form.Convert the provided map property value into a XTDB comparable form.Methods inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.InstancePropertyValueMapping
addInstancePropertyValueToDoc, getKeywordsForProperty, getValueForComparison, getValueForComparison
Methods inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.AbstractMapping
getDeserializedValue, getDeserializedValue, getEmbeddedSerializedForm, getEmbeddedSerializedForm, getKeyword, getKeyword
-
Constructor Details
-
MapPropertyValueMapping
public MapPropertyValueMapping()
-
-
Method Details
-
addMapPropertyValueToDoc
public static void addMapPropertyValueToDoc(XTDBOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument.Builder builder, PropertyKeywords keywords, MapPropertyValue value) Add the provided map value to the XTDB document.- Parameters:
xtdbConnector
- connectivity to the repositorybuilder
- to which to add the property valuekeywords
- of the propertyvalue
- of the property
-
addMapPropertyValueToDoc
public static clojure.lang.IPersistentMap addMapPropertyValueToDoc(clojure.lang.IPersistentMap doc, clojure.lang.Keyword propertyKeyword, MapPropertyValue value) throws InvalidParameterException Add the provided map value to the XTDB map.- Parameters:
doc
- the XTDB map to which to add the propertypropertyKeyword
- the property whose value should be set, fully-qualified with namespace and type namevalue
- of the property- Returns:
- IPersistentMap containing the updated XTDB map
- Throws:
InvalidParameterException
- if the value cannot be persisted
-
getMapPropertyValueForComparison
public static Map<String,Object> getMapPropertyValueForComparison(XTDBOMRSRepositoryConnector xtdbConnector, MapPropertyValue mpv) Convert the provided map property value into a XTDB comparable form.- Parameters:
xtdbConnector
- connectivity to the repositorympv
- Egeria value to translate to XTDB-comparable value- Returns:
Map<String, Object>
value that XTDB can compare
-
getMapPropertyValueForComparison
public static Map<String,Object> getMapPropertyValueForComparison(MapPropertyValue mpv) throws InvalidParameterException Convert the provided map property value into a XTDB comparable form.- Parameters:
mpv
- Egeria value to translate to XTDB-comparable value- Returns:
Map<String, Object>
value that XTDB can compare- Throws:
InvalidParameterException
- if the value cannot be persisted
-