Package xtdb.api.tx
Class Transaction.Builder
java.lang.Object
xtdb.api.tx.Transaction.Builder
- Enclosing class:
- Transaction
-
Method Summary
Modifier and TypeMethodDescriptionadd
(TransactionOperation operation) build()
Adds a delete operation to the transaction, deleting the given document from validTime = now.Adds a delete operation to the transaction, deleting the given document starting from the given valid timeAdds a delete operation to the transaction, deleting the given document starting for the given validTime rangeAdds an evict operation to the transaction, removing all trace of the entity with the given ID.invokeFunction
(Object id, Object... arguments) Adds a transaction function invocation operation to the transaction.match
(XtdbDocument document) Adds a match operation to the transaction.match
(XtdbDocument document, Date atValidTime) Adds a match operation to the transaction.matchNotExists
(Object id) Adds a match operation to the transaction.matchNotExists
(Object id, Date atValidTime) Adds a match operation to the transaction.put
(XtdbDocument document) Adds a put operation to the transaction, putting the given document at validTime = now.put
(XtdbDocument document, Date startValidTime) Adds a put operation to the transaction, putting the given document starting from the given valid timeput
(XtdbDocument document, Date startValidTime, Date endValidTime) Adds a put operation to the transaction, putting the given document starting for the given validTime rangewithTxTime
(Date txTime) Overrides the txTime of the transaction, for use in imports.
-
Method Details
-
add
-
put
Adds a put operation to the transaction, putting the given document at validTime = now.- Returns:
- this
-
put
Adds a put operation to the transaction, putting the given document starting from the given valid time- Returns:
- this
-
put
Adds a put operation to the transaction, putting the given document starting for the given validTime range- Returns:
- this
-
delete
Adds a delete operation to the transaction, deleting the given document from validTime = now.- Returns:
- this
-
delete
Adds a delete operation to the transaction, deleting the given document starting from the given valid time- Returns:
- this
-
delete
Adds a delete operation to the transaction, deleting the given document starting for the given validTime range- Returns:
- this
-
evict
Adds an evict operation to the transaction, removing all trace of the entity with the given ID. Eviction also removes all history of the entity - unless you are required to do this, (for legal reasons, for example) we'd recommend using adelete(Object)
instead, to preserve the history of the entity.- Returns:
- this
-
matchNotExists
Adds a match operation to the transaction. Asserts that the given entity ID does not exist at validTime = now, otherwise the transaction will abort.- Returns:
- this
-
match
Adds a match operation to the transaction. Asserts that the given document is present at validTime = now, otherwise the transaction will abort.- Returns:
- this
-
matchNotExists
Adds a match operation to the transaction. Asserts that the given entity ID does not exist at the given validTime, otherwise the transaction will abort.- Returns:
- this
-
match
Adds a match operation to the transaction. Asserts that the given document is present at the given valid time, otherwise the transaction will abort.- Returns:
- this
-
invokeFunction
Adds a transaction function invocation operation to the transaction. Invokes the transaction function with the given id, passing it the given arguments.- Returns:
- this
-
withTxTime
Overrides the txTime of the transaction, for use in imports. Mustn't be older than any other transaction already submitted to XT, nor newer than the TxLog's clock.- Parameters:
txTime
- overridden transaction time of this transaction.- Returns:
- this
-
build
-