DelegatedCRUDRepoAsync<Domain extends BasicDomainObject<IntIdentifier>, Entity extends BasicEntityObject, ExternalRepo extends CRUDRepositoryFrameworkAsync<Entity>> class abstract

Default implementation of CRUDRepository of type Domain extends BasicDomainObject & Entity extends BasicEntityObject

EXAMPLE: This is the implementation of ParentRepo. See BasicDomainObject for ParentDomain's example code. See BasicEntityObject for ParentEntity's example code. See CRUDRepository for ParentRepo's example code.

  class ParentRepoImpl extends DefaultCRUDRepoAsync<ParentDomain, ParentEntity>
      implements ParentRepo {
      @override
      void doStuffInRepo(){
        print('Doing Stuff in the repository layer...');
      }
  }
Inheritance

Constructors

DelegatedCRUDRepoAsync({required ExternalRepo externalRepo, required GeneralConverter<Domain, Entity> converter})
Default Constructor

Properties

converter GeneralConverter<Domain, Entity>
Converter of this repo, hadler of transaction domain <==> entity
getter/setter pair
externalRepo ↔ ExternalRepo
External repo, the one who really do the operations.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

count() Future<int>
Count the amount of domains.
override
create(Domain newObject) Future<Domain>
Create the domain Return the domain after been persisted, the returned domain have the properties assigned by the repo, like the new id.
override
delete(Domain objectToDestroy) Future<void>
Destroy the domain.
override
deleteById(int id) Future<void>
Destroy the domain.
override
dispose() Future<void>
override
edit(Domain objectToEdit) Future<Domain>
Edit the domain
override
findAll() Future<List<Domain>>
Find all domains
override
findById(int keyId) Future<Domain?>
Find the correspondent domain by it's Key Id.
override
init() Future<void>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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