Repository<TEntity> class abstract

Defines data access methods to a specific database collection.

The TEntity type parameter is mostly a convenience parameter to facilitate the usage of dependency-injection containers. If you are not using a DI container or your DI container does not use type-parameters, you can safely ignore it.

Constructors

Repository()

Properties

createPolicy CreatePolicy
no setter
deletePolicy DeletePolicy
default authorization policy for delete operations
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
searchPolicy SearchPolicy
default authorization policy for search operations
no setter
updatePolicy UpdatePolicy
default authorization policy for update operations
no setter

Methods

abortTransaction(RepositoryTransaction transaction) Future
beginTransaction(RepositoryTransactionOptions options) Future<RepositoryTransaction>
commitTransaction(RepositoryTransaction transaction) Future
count(SearchCriteria criteria, DbPrincipal principal, {SearchPolicy? searchPolicy, RepositoryTransaction? transaction}) Future<int>
Searches entities according to criteria and returns the total count of entities fitting the constraints.
create(Map<String, dynamic> map, DbPrincipal principal, {CreatePolicy? createPolicy, RepositoryTransaction? transaction}) Future<Map<String, dynamic>>
Inserts the map as a new entity in the database collection.
delete(String key, DbPrincipal principal, {DeletePolicy? deletePolicy, RepositoryTransaction? transaction}) Future
Deletes the entity from the collection identified by the key parameter.
get(String key, DbPrincipal principal, {SearchPolicy? searchPolicy, RepositoryTransaction? transaction}) Future<Map<String, dynamic>>
Retrieves an entity from the collection identified by the key parameter.
getAllToList(DbPrincipal principal, {SearchPolicy? searchPolicy, RepositoryTransaction? transaction}) Future<List<Map<String, dynamic>>>
getAllToStream(DbPrincipal principal, {SearchPolicy? searchPolicy, RepositoryTransaction? transaction}) Future<Stream<Map<String, dynamic>>>
Gets all the entities from the collection identified by the key parameter. Use this method only with collections where the number of elements in the collection (per tenant) is guaranteed to be very limited.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
searchToList(SearchCriteria criteria, DbPrincipal principal, {SearchPolicy? searchPolicy, RepositoryTransaction? transaction}) Future<List<Map<String, dynamic>>>
searchToStream(SearchCriteria criteria, DbPrincipal principal, {SearchPolicy? searchPolicy, RepositoryTransaction? transaction}) Future<Stream<Map<String, dynamic>>>
Searches entities according to criteria, returning all the entities that fit the constraints.
searchWithCount(SearchCriteria criteria, DbPrincipal principal, {SearchPolicy? searchPolicy, RepositoryTransaction? transaction}) Future<SearchResult>
Searches entities according to criteria, returning a page of entities and the count of total entities that fit the given constraints.
toString() String
A string representation of this object.
inherited
update(Map<String, dynamic> map, DbPrincipal principal, {UpdatePolicy? updatePolicy, RepositoryTransaction? transaction}) Future<Map<String, dynamic>>
Update an entity in the collection contained in the map parameter.

Operators

operator ==(Object other) bool
The equality operator.
inherited