public class RelationshipMapping extends InstanceHeaderMapping
Maps the properties of Relationships between persistence and objects.
  • Field Details

  • Constructor Details

    • RelationshipMapping

      public RelationshipMapping(XTDBOMRSRepositoryConnector xtdbConnector, Relationship relationship)
      Construct a mapping from a Relationship (to map to a XTDB representation).
      Parameters:
      xtdbConnector - connectivity to XTDB
      relationship - from which to map
    • RelationshipMapping

      public RelationshipMapping(XTDBOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument xtdbDoc, xtdb.api.IXtdbDatasource db)
      Construct a mapping from a XTDB map (to map to an Egeria representation).
      Parameters:
      xtdbConnector - connectivity to XTDB
      xtdbDoc - from which to map
      db - an open database connection for a point-in-time appropriate to the mapping
  • Method Details

    • toEgeria

      public Relationship toEgeria()
      Map from XTDB to Egeria.
      Returns:
      EntityDetail
      See Also:
    • toDoc

      protected xtdb.api.XtdbDocument.Builder toDoc()
      Translate the provided Egeria representation into a XTDB document.
      Overrides:
      toDoc in class InstanceHeaderMapping
      Returns:
      XtdbDocument.Builder from which to build the document
    • toMap

      public static clojure.lang.IPersistentMap toMap(Relationship relationship) throws InvalidParameterException, IOException
      Translate the provided Egeria representation into a XTDB document map.
      Parameters:
      relationship - to translate
      Returns:
      IPersistentMap representing the XTDB document
      Throws:
      InvalidParameterException - on any errors identified within the metadata instance
      IOException - on any error serializing the values
    • fromDoc

      protected void fromDoc()
      Translate the provided XTDB representation into an Egeria representation.
      Overrides:
      fromDoc in class InstanceHeaderMapping
    • getReference

      public static String getReference(String guid)
      Retrieve the canonical reference to the relationship with the specified GUID.
      Parameters:
      guid - of the relationship to reference
      Returns:
      String giving the XTDB reference to this relationship document