Interface TransactionData


public interface TransactionData
Represents the data that has changed during the course of one transaction. It consists of what has happened in the transaction compared to how it was before the transaction started. This implies f.ex. that a node which is created, modified and then deleted in the same transaction won't be seen in the transaction data at all.
  • Method Details

    • createdNodes

      Iterable<Node> createdNodes()
      Get the nodes that were created during the transaction.
      Returns:
      all nodes that were created during the transaction.
    • deletedNodes

      Iterable<Node> deletedNodes()
      Get the nodes that were deleted during the transaction.
      Returns:
      all nodes that were deleted during the transaction.
    • isDeleted

      boolean isDeleted(Node node)
      Returns whether or not node is deleted in this transaction.
      Parameters:
      node - the Node to check whether or not it is deleted in this transaction.
      Returns:
      whether or not node is deleted in this transaction.
    • assignedNodeProperties

      Iterable<PropertyEntry<Node>> assignedNodeProperties()
      Get the properties that had a value assigned or overwritten on a node during the transaction. All the properties of nodes created during the transaction will be returned by this method as well. Only the values that are present at the end of the transaction will be returned, whereas all previously assigned values of properties that have been assigned multiple times during the transaction will not be returned.
      Returns:
      all properties that have been assigned on nodes.
    • removedNodeProperties

      Iterable<PropertyEntry<Node>> removedNodeProperties()
      Get the properties that had a value removed from a node during the transaction. Values are considered to be removed if the value is overwritten by calling Entity.setProperty(String, Object) with a property that has a previous value, or if the property is explicitly removed by calling Entity.removeProperty(String). Only the values that were present before the transaction are returned by this method, all previous values of properties that have been assigned multiple times during the transaction will not be returned. This is also true for properties that had no value before the transaction, was assigned during the transaction, and then removed during the same transaction. Deleting a node will cause all its currently assigned properties to be added to this list as well.
      Returns:
      all properties that have been removed from nodes.
    • assignedLabels

      Iterable<LabelEntry> assignedLabels()
      Get all new labels that have been assigned during the transaction. This will return one entry for each label added to each node. All labels assigned to nodes that were created in the transaction will also be included.
      Returns:
      all labels assigned on nodes.
    • removedLabels

      Iterable<LabelEntry> removedLabels()
      Get all labels that have been removed from nodes during the transaction.
      Returns:
      all labels removed from nodes.
    • createdRelationships

      Iterable<Relationship> createdRelationships()
      Get the relationships that were created during the transaction.
      Returns:
      all relationships that were created during the transaction.
    • deletedRelationships

      Iterable<Relationship> deletedRelationships()
      Get the relationships that were deleted during the transaction.
      Returns:
      all relationships that were deleted during the transaction.
    • isDeleted

      boolean isDeleted(Relationship relationship)
      Returns whether or not relationship is deleted in this transaction.
      Parameters:
      relationship - the Relationship to check whether or not it is deleted in this transaction.
      Returns:
      whether or not relationship is deleted in this transaction.
    • assignedRelationshipProperties

      Iterable<PropertyEntry<Relationship>> assignedRelationshipProperties()
      Get the properties that had a value assigned on a relationship during the transaction. If the property had a value on that relationship before the transaction started the previous value will be returned by removedRelationshipProperties(). All the properties of relationships created during the transaction will be returned by this method as well. Only the values that are present at the end of the transaction will be returned by this method, all previously assigned values of properties that have been assigned multiple times during the transaction will not be returned.
      Returns:
      all properties that have been assigned on relationships.
    • removedRelationshipProperties

      Iterable<PropertyEntry<Relationship>> removedRelationshipProperties()
      Get the properties that had a value removed from a relationship during the transaction. Values are considered to be removed if the value is overwritten by calling Entity.setProperty(String, Object) with a property that has a previous value, or if the property is explicitly removed by calling Entity.removeProperty(String) . Only the values that were present before the transaction are returned by this method, all previous values of properties that have been assigned multiple times during the transaction will not be returned. This is also true for properties that had no value before the transaction, was assigned during the transaction, and then removed during the same transaction. Deleting a relationship will cause all its currently assigned properties to be added to this list as well.
      Returns:
      all properties that have been removed from relationships.
    • username

      String username()
      Get the username under which authorization state this transaction is running.
      Returns:
      the username of the user who initiated the transaction.
    • metaData

      Map<String,Object> metaData()
      Applications that start transactions may attach additional application specific meta-data to each transaction.
      Returns:
      The application specific meta-data map associated with this transaction.
    • getTransactionId

      default long getTransactionId()
      Return transaction id that assigned during transaction commit process.
      Returns:
      transaction id.
      Throws:
      IllegalStateException - if transaction id is not assigned yet
    • getCommitTime

      default long getCommitTime()
      Return transaction commit time (in millis) that assigned during transaction commit process.
      Returns:
      transaction commit time
      Throws:
      IllegalStateException - if commit time is not assigned yet