Class InstancePropertiesMapping
java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.InstancePropertiesMapping
Maps the properties of InstanceProperties between persistence and objects.
The values of the properties (InstancePropertyValue) will be both JSON-serialized and searchable.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addToDoc
(XTDBOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument.Builder builder, InstanceType type, InstanceProperties properties) Add the provided instance property values to the XTDB document.static clojure.lang.IPersistentMap
addToMap
(clojure.lang.IPersistentMap doc, String typeDefGUID, InstanceProperties properties) Add the provided instance property values to the XTDB document map.static InstanceProperties
getFromDoc
(XTDBOMRSRepositoryConnector xtdbConnector, InstanceType type, xtdb.api.XtdbDocument xtdbDoc) Retrieve the instance property values from the provided XTDB document.static InstanceProperties
getFromMap
(InstanceType type, clojure.lang.IPersistentMap doc) Translate the provided XTDB representation into an Egeria representation.
-
Method Details
-
getFromDoc
public static InstanceProperties getFromDoc(XTDBOMRSRepositoryConnector xtdbConnector, InstanceType type, xtdb.api.XtdbDocument xtdbDoc) Retrieve the instance property values from the provided XTDB document. NOTE: whether empty or null, the instance properties will always be returned back from the XTDB representation as an empty set of properties (not null).- Parameters:
xtdbConnector
- connectivity to the repositorytype
- of the Egeria instance from which we are retrieving the valuesxtdbDoc
- from which to retrieve the values- Returns:
- InstanceProperties
-
getFromMap
public static InstanceProperties getFromMap(InstanceType type, clojure.lang.IPersistentMap doc) throws IOException Translate the provided XTDB representation into an Egeria representation.- Parameters:
type
- of the Egeria instance from which we are retrieving the valuesdoc
- from which to map- Returns:
- InstanceProperties
- Throws:
IOException
- on any issue deserializing values
-
addToDoc
public static void addToDoc(XTDBOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument.Builder builder, InstanceType type, InstanceProperties properties) Add the provided instance property values to the XTDB document.- Parameters:
xtdbConnector
- connectivity to the repositorybuilder
- to which to add the propertiestype
- of the Egeria instance to which the values are being addedproperties
- to add
-
addToMap
public static clojure.lang.IPersistentMap addToMap(clojure.lang.IPersistentMap doc, String typeDefGUID, InstanceProperties properties) throws InvalidParameterException, IOException Add the provided instance property values to the XTDB document map.- Parameters:
doc
- metadata instance in XTDB document map form to which to add the propertiestypeDefGUID
- of the Egeria instance to which the values are being addedproperties
- full set of properties for the instance- Returns:
- IPersistentMap giving the updated instance representation
- Throws:
InvalidParameterException
- if any of the properties cannot be persistedIOException
- on any error serializing the properties
-