Repository<T> class
abstract
Generic repository interface for CRUD operations.
- Implementers
Constructors
Properties
Methods
-
add(
IdentifiedObject< T> item) → Future<T> - Adds a new item to the repository.
-
addAll(
Iterable< IdentifiedObject< items) → Future<T> >Iterable< T> > - Adds multiple items to the repository.
-
addAutoIdentified(
T object, {T updateObjectWithId(T object, String id)?}) → Future< T> - Convenience method that combines autoIdentify and add.
-
autoIdentify(
T object, {T updateObjectWithId(T object, String id)?}) → IdentifiedObject< T> - Generates a unique ID for an object and returns an IdentifiedObject.
-
delete(
String id) → Future< void> - Deletes an item from the repository.
-
deleteAll(
Iterable< String> ids) → Future<void> - Deletes multiple items from the repository.
-
dispose(
) → void - Disposes of the repository and cleans up resources.
-
get(
String id) → Future< T> - Returns the item with the given ID. Throws RepositoryException.notFound if the item does not exist.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
query(
{Query query = const AllQuery()}) → Future< List< T> > - Queries for items matching the given query.
-
stream(
String id) → Stream< T> - Creates a real-time stream of changes for a specific document.
-
streamQuery(
{Query query = const AllQuery()}) → Stream< List< T> > - Creates a real-time stream of query results.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
String id, T updater(T current)) → Future< T> - Updates an existing item in the repository.
-
updateAll(
Iterable< IdentifiedObject< items) → Future<T> >Iterable< T> > - Updates multiple items in the repository.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited