ModelAdapter class abstract
You can implement adapters that define the internal specifications of the model.
The loading process is implemented in ModelAdapter.loadDocument or ModelAdapter.loadCollection.
When saving data for a document (saving and deleting data for a collection is systematically prohibited) is implemented in ModelAdapter.saveDocument, and deleting is implemented in ModelAdapter.deleteDocument.
If each model is to be destroyed, implement and execute ModelAdapter.disposeDocument or ModelAdapter.disposeCollection.
You can also get the default adapter from ModelAdapter.primary.
ModelAdapter.primary is automatically set through ModelAdapterScope executed at the top level.
If ModelAdapterScope is not running, RuntimeModelAdapter will be called.
モデルの内部仕様を定義するアダプターを実装できます。
読み込み時の処理はModelAdapter.loadDocumentやModelAdapter.loadCollectionに実装します。
ドキュメントのデータ保存時(コレクションのデータ保存・削除はシステム的に禁止)はModelAdapter.saveDocumentに実装し、削除はModelAdapter.deleteDocumentに実装します。
各モデルが破棄される場合はModelAdapter.disposeDocumentやModelAdapter.disposeCollectionを実装し実行してください。
またデフォルトのアダプターをModelAdapter.primaryから取得できます。 ModelAdapter.primaryはトップレベルで実行されたModelAdapterScopeを通して自動的に設定されます。
ModelAdapterScopeが実行されていない場合にはRuntimeModelAdapterが呼び出されます。
- Implementers
- Annotations
Constructors
- ModelAdapter()
-
You can implement adapters that define the internal specifications of the model.
const
Properties
- availableListen → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearAll(
) → Future< void> - Delete all data in the database.
-
clearCache(
) → Future< void> - If the database is taking a local cache, delete it.
-
deleteDocument(
ModelAdapterDocumentQuery query) → Future< void> -
Delete data from the platform set by the adapter by passing
query
. -
deleteOnBatch(
ModelBatchRef ref, ModelAdapterDocumentQuery query) → void - Describe the data deletion process when performing a batch.
-
deleteOnTransaction(
ModelTransactionRef ref, ModelAdapterDocumentQuery query) → void - Describe the data deletion process when performing a transaction.
-
disposeCollection(
ModelAdapterCollectionQuery query) → void -
The associated collection is discarded by passing
query
. -
disposeDocument(
ModelAdapterDocumentQuery query) → void -
The destruction of related documents is handled by passing
query
. -
hasMatch(
{required String path, required String pattern}) → List< String> ? -
Determines if
path
matchespattern
of the formxxxxx/:id/yyyy
. -
listenCollection(
ModelAdapterCollectionQuery query) → Future< List< StreamSubscription> > -
Pass
query
to monitor the collection. -
listenDocument(
ModelAdapterDocumentQuery query) → Future< List< StreamSubscription> > -
Pass
query
to monitor the document. -
loadAggregation<
T> (ModelAdapterCollectionQuery query, ModelAggregateQuery< AsyncAggregateValue> aggregateQuery) → Future<T?> - Aggregate queries against data collections to retrieve data.
-
loadCollection(
ModelAdapterCollectionQuery query) → Future< Map< String, DynamicMap> > -
Pass
query
to the platform set by the adapter to retrieve the collection. -
loadDocument(
ModelAdapterDocumentQuery query) → Future< DynamicMap> -
Pass
query
to the platform set by the adapter to retrieve the document. -
loadOnTransaction(
ModelTransactionRef ref, ModelAdapterDocumentQuery query) → FutureOr< DynamicMap> - Describe the data acquisition process when performing a transaction.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
runBatch(
FutureOr< void> batch(ModelBatchRef ref), int splitLength) → FutureOr<void> - Processes a batch for execution.
-
runTransaction(
FutureOr< void> transaction(ModelTransactionRef ref)) → FutureOr<void> - Do the processing to execute the transaction.
-
saveDocument(
ModelAdapterDocumentQuery query, DynamicMap value) → Future< void> -
By passing the
query
and thevalue
to be stored, the data is stored on the platform set by the adapter. -
saveOnBatch(
ModelBatchRef ref, ModelAdapterDocumentQuery query, DynamicMap value) → void - Describe the data storage process when performing a batch.
-
saveOnTransaction(
ModelTransactionRef ref, ModelAdapterDocumentQuery query, DynamicMap value) → void - Describes the data storage process when performing a transaction.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- primary → ModelAdapter
-
You can get the default adapter.
no setter