Class StructPropertyValueMapping
- java.lang.Object
-
- org.odpi.egeria.connectors.juxt.xtdb.mapping.AbstractMapping
-
- org.odpi.egeria.connectors.juxt.xtdb.mapping.InstancePropertyValueMapping
-
- org.odpi.egeria.connectors.juxt.xtdb.mapping.StructPropertyValueMapping
-
public class StructPropertyValueMapping extends InstancePropertyValueMapping
Maps singular StructPropertyValues 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\":\"StructPropertyValue\",\"instancePropertyCategory\":\"STRUCT\",\"attributes\":{\"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.egeria.connectors.juxt.xtdb.mapping.AbstractMapping
mapper, xtdbConnector
-
-
Constructor Summary
Constructors Constructor Description StructPropertyValueMapping()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static clojure.lang.IPersistentMapaddStructPropertyValueToDoc(clojure.lang.IPersistentMap doc, clojure.lang.Keyword propertyKeyword, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue value)Add the provided struct value to the XTDB map.static voidaddStructPropertyValueToDoc(XtdbOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument.Builder builder, PropertyKeywords keywords, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue value)Add the provided struct value to the XTDB document.static Map<String,Object>getStructPropertyValueForComparison(XtdbOMRSRepositoryConnector xtdbConnector, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue spv)Convert the provided struct property value into a XTDB comparable form.static Map<String,Object>getStructPropertyValueForComparison(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue spv)Convert the provided struct property value into a XTDB comparable form.-
Methods inherited from class org.odpi.egeria.connectors.juxt.xtdb.mapping.InstancePropertyValueMapping
addInstancePropertyValueToDoc, getKeywordsForProperty, getValueForComparison, getValueForComparison
-
Methods inherited from class org.odpi.egeria.connectors.juxt.xtdb.mapping.AbstractMapping
getDeserializedValue, getDeserializedValue, getEmbeddedSerializedForm, getEmbeddedSerializedForm, getKeyword, getKeyword
-
-
-
-
Method Detail
-
addStructPropertyValueToDoc
public static void addStructPropertyValueToDoc(XtdbOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument.Builder builder, PropertyKeywords keywords, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue value)
Add the provided struct value to the XTDB document.- Parameters:
xtdbConnector- connectivity to the repositorybuilder- to which to add the property valuekeywords- of the propertyvalue- of the property
-
addStructPropertyValueToDoc
public static clojure.lang.IPersistentMap addStructPropertyValueToDoc(clojure.lang.IPersistentMap doc, clojure.lang.Keyword propertyKeyword, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue value) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterExceptionAdd the provided struct 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 doc
- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- if the value cannot be persisted
-
getStructPropertyValueForComparison
public static Map<String,Object> getStructPropertyValueForComparison(XtdbOMRSRepositoryConnector xtdbConnector, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue spv)
Convert the provided struct property value into a XTDB comparable form.- Parameters:
xtdbConnector- connectivity to the repositoryspv- Egeria value to translate to XTDB-comparable value- Returns:
Map<String, Object>value that XTDB can compare
-
getStructPropertyValueForComparison
public static Map<String,Object> getStructPropertyValueForComparison(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue spv) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException
Convert the provided struct property value into a XTDB comparable form.- Parameters:
spv- Egeria value to translate to XTDB-comparable value- Returns:
Map<String, Object>value that XTDB can compare- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException- if the value cannot be persisted
-
-