ModelTransactionBuilder<T> class
Builder for transactions.
The invoked transaction can be call
as is, and transaction processing can be performed by executing ModelTransactionDocument.load, ModelTransactionDocument.save, and ModelTransactionDocument.delete.
ModelTransactionRef.read] can be used to create a ModelTransactionDocument from another DocumentBase and describe the process to be performed together.
トランザクションを行うためのビルダー。
呼び出されたトランザクションはそのままcall
することができ、その引数から与えられるModelTransactionDocumentを用いてModelTransactionDocument.load、ModelTransactionDocument.save、ModelTransactionDocument.deleteを実行することでトランザクション処理を行うことが可能です。
ModelTransactionRef.readを用いて他のDocumentBaseからModelTransactionDocumentを作成することができ、まとめて実行する処理を記述することができます。
final transaction = sourceDocument.transaction();
transaction((ref, doc){ // `doc` is [ModelTransactionDocument] of `sourceDocument`.
final newValue = {"name": "test"}; // The same mechanism can be used to perform the same preservation method as usual.
doc.save(newValue);
});
- Available Extensions
Properties
-
document
→ DocumentBase<
T> -
Original document.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call(
FutureOr< void> transaction(ModelTransactionRef ref, ModelTransactionDocument<T> doc)) → FutureOr<void> -
transaction
is passed as a callback to execute the transaction. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited