ModelAdapter constructor

const ModelAdapter()

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.loadDocumentModelAdapter.loadCollectionに実装します。

ドキュメントのデータ保存時(コレクションのデータ保存・削除はシステム的に禁止)はModelAdapter.saveDocumentに実装し、削除はModelAdapter.deleteDocumentに実装します。

各モデルが破棄される場合はModelAdapter.disposeDocumentModelAdapter.disposeCollectionを実装し実行してください。

またデフォルトのアダプターをModelAdapter.primaryから取得できます。 ModelAdapter.primaryはトップレベルで実行されたModelAdapterScopeを通して自動的に設定されます。

ModelAdapterScopeが実行されていない場合にはRuntimeModelAdapterが呼び出されます。

Implementation

const ModelAdapter();