DefaultCRUDRepo<Domain extends BasicDomainObject<IntIdentifier>, Entity extends BasicEntityObject<Domain>> class Null safety

Default implementation of CRUDRepository of type Domain extends BasicDomainObject & Entity extends BasicEntityObject It's basically a delegate to the External repo.

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 DefaultCRUDRepo<ParentDomain, ParentEntity>
      implements ParentRepo {
      @override
      void doStuffInRepo(){
        print('Doing Stuff in the repository layer...');
      }
  }
Inheritance

Constructors

DefaultCRUDRepo({required CRUDRepositoryExternal<Entity> externalRepo, required GeneralConverter<Domain, Entity> converter})
Default Constructor

Properties

converter GeneralConverter<Domain, Entity>
Converter of this repo, hadler of transaction domain <==> entity
read / write
externalRepo CRUDRepositoryExternal<Entity>
External repo, the one who really do the operations.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

count() int
Count the amount of domains.
override
create(Domain newObject) → 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
destroy(Domain objectToDestroy) → Domain
Destroy the domain.
override
dispose() → void
override
edit(Domain objectToEdit) → Domain
Edit the domain
override
findAll() List<Domain>
Find all domains
override
findBy(int keyId) → Domain
Find the correspondent domain by it's Key Id.
override
init() → void
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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