Class SaveRelationshipReferenceCopy
java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.txnfn.AbstractTransactionFunction
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.txnfn.SaveRelationshipReferenceCopy
Transaction function for adding a reference copy relationship.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSaveRelationshipReferenceCopy
(Long txId, clojure.lang.PersistentHashMap existing, clojure.lang.PersistentHashMap updated, String homeMetadataCollectionId) Constructor used to execute the transaction function. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
create
(xtdb.api.tx.Transaction.Builder tx) Create the transaction function within XTDB.clojure.lang.IPersistentMap
doc()
Interface that returns the updated document to write-back from the transaction.static void
transact
(XTDBOMRSRepositoryConnector xtdb, Relationship toSave) Create the provided relationship instance in the XTDB repository by pushing down the transaction.Methods inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.txnfn.AbstractTransactionFunction
createTransactionFunction, getGUID, getInstanceProvenanceType, getMetadataCollectionId, getTxnTimeCalculation, getTypeDefForInstance, getTypeDefGUID, incrementVersion, incrementVersion
-
Field Details
-
FUNCTION_NAME
public static final clojure.lang.Keyword FUNCTION_NAME
-
-
Constructor Details
-
SaveRelationshipReferenceCopy
public SaveRelationshipReferenceCopy(Long txId, clojure.lang.PersistentHashMap existing, clojure.lang.PersistentHashMap updated, String homeMetadataCollectionId) throws Exception Constructor used to execute the transaction function.- Parameters:
txId
- the transaction ID of this function invocationexisting
- the existing relationship in XT, if anyupdated
- the updated relationship to replace the existing one withhomeMetadataCollectionId
- the metadataCollectionId of the repository where the transaction is running- Throws:
Exception
- on any error
-
-
Method Details
-
transact
public static void transact(XTDBOMRSRepositoryConnector xtdb, Relationship toSave) throws RelationshipConflictException, HomeRelationshipException, InvalidParameterException, RepositoryErrorException Create the provided relationship instance in the XTDB repository by pushing down the transaction.- Parameters:
xtdb
- connectivitytoSave
- the relationship reference copy to persist- Throws:
RelationshipConflictException
- the new relationship conflicts with an existing relationshipHomeRelationshipException
- if the relationship belongs to the local repository so cannot be a reference copyInvalidParameterException
- one of the parameters is invalid or nullRepositoryErrorException
- on any other error
-
doc
public clojure.lang.IPersistentMap doc()Interface that returns the updated document to write-back from the transaction.- Returns:
- IPersistentMap giving the updated document in its entirety
-
create
public static void create(xtdb.api.tx.Transaction.Builder tx) Create the transaction function within XTDB.- Parameters:
tx
- transaction through which to create the function
-