entity
library
Classes
-
Access
-
An access channel, aka., a connection, to a database,
such as Couchbase and MySQL.
-
AccessAgent
-
An agent for handling load, update, create and delete
from/into database.
-
AccessOption
-
Options to access the database.
-
AccessReader
-
A reader for converting data read from the database.
-
AccessWriter
-
A writer for converting data for saving to the database.
The plugin shall implement its own converters.
-
CachedAccessReader
-
An extension of AccessReader that support a cache.
-
Entity
-
An entity which can be stored into an entity store.
-
EntityCache
-
A cache for storing entities.
-
MultiLoad
-
The interface to decorate Entity if it allowed to load
into the same entity multiple times (with different fields).
Functions
-
bind_<T extends Entity>(Access access, String oid, T newInstance(String oid), Map data, Iterable<String>? fields)
→ T
-
Binds the
data
to the entify with the given oid
.
If the entity doesn't exists, it will instantiate one.
-
load<T extends Entity>(Access access, String oid, T newInstance(String oid), [Iterable<String>? fields, AccessOption? option])
→ Future<T>
-
Loads the data of the given OID from the storage into the given entity.
-
loadIfAny<T extends Entity>(Access access, String? oid, T newInstance(String oid), [Iterable<String>? fields, AccessOption? option])
→ Future<T?>
-
Loads the entity of the given OID, and return a Future carrying
null if not found.
-
loadIfAny_<T extends Entity>(Access access, String? oid, T newInstance(String oid), FutureOr<Map?> loader(T entity, Iterable<String>? fields, AccessOption? option), Iterable<String>? fields, [AccessOption? option])
→ Future<T?>
-
A utility to implement loadIfAny and custom load functions.
-
minify<K>(Map<K, dynamic>? json)
→ Map<K, dynamic>?
-
Minimizes the JSON map to be stored into DB or sent over internet
by removing the entries whose value is null.
-
minifyNS<K>(Map<K, dynamic> json)
→ Map<K, dynamic>
-
A null-safety version of minify.
-
read_<T extends Entity>(Access access, T entity, Map data, Iterable<String>? fields)
→ T
-
Reads properties from
data
into entity
, by calling Entity.read.
It also handles if entity
implements MultiLoad.