Package org.neo4j.graphdb.event
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 Summary
Modifier and TypeMethodDescriptionGet all new labels that have been assigned during the transaction.Get the properties that had a value assigned or overwritten on a node during the transaction.Get the properties that had a value assigned on a relationship during the transaction.Get the nodes that were created during the transaction.Get the relationships that were created during the transaction.Get the nodes that were deleted during the transaction.Get the relationships that were deleted during the transaction.default long
Return transaction commit time (in millis) that assigned during transaction commit process.default long
Return transaction id that assigned during transaction commit process.boolean
Returns whether or notnode
is deleted in this transaction.boolean
isDeleted
(Relationship relationship) Returns whether or notrelationship
is deleted in this transaction.metaData()
Applications that start transactions may attach additional application specific meta-data to each transaction.Get all labels that have been removed from nodes during the transaction.Get the properties that had a value removed from a node during the transaction.Get the properties that had a value removed from a relationship during the transaction.username()
Get the username under which authorization state this transaction is running.
-
Method Details
-
createdNodes
Get the nodes that were created during the transaction.- Returns:
- all nodes that were created during the transaction.
-
deletedNodes
Get the nodes that were deleted during the transaction.- Returns:
- all nodes that were deleted during the transaction.
-
isDeleted
Returns whether or notnode
is deleted in this transaction.- Parameters:
node
- theNode
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 callingEntity.setProperty(String, Object)
with a property that has a previous value, or if the property is explicitly removed by callingEntity.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
Returns whether or notrelationship
is deleted in this transaction.- Parameters:
relationship
- theRelationship
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 byremovedRelationshipProperties()
. 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 callingEntity.setProperty(String, Object)
with a property that has a previous value, or if the property is explicitly removed by callingEntity.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
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
-