Page Contents

Home > @loopback/repository > DefaultCrudRepository

DefaultCrudRepository class

Default implementation of CRUD repository using legacy juggler model and data source

Signature:

export declare class DefaultCrudRepository<T extends Entity, ID, Relations extends object = {}> implements EntityCrudRepository<T, ID, Relations> 

Constructors

Constructor Modifiers Description
(constructor)(entityClass, dataSource)   Constructor of DefaultCrudRepository

Properties

Property Modifiers Type Description
dataSource   juggler.DataSource  
entityClass   typeof Entity & {
prototype: T;
}
 
modelClass   juggler.PersistedModelClass  

Methods

Method Modifiers Description
_createBelongsToAccessorFor(relationName, targetRepoGetter)    
_createHasManyRepositoryFactoryFor(relationName, targetRepoGetter)    
_createHasOneRepositoryFactoryFor(relationName, targetRepoGetter)    
count(where, options)    
create(entity, options)    
createAll(entities, options)    
createBelongsToAccessorFor(relationName, targetRepoGetter)   Function to create a belongs to accessor
createHasManyRepositoryFactoryFor(relationName, targetRepoGetter)   Function to create a constrained relation repository factory
createHasOneRepositoryFactoryFor(relationName, targetRepoGetter)   Function to create a constrained hasOne relation repository factory
delete(entity, options)    
deleteAll(where, options)    
deleteById(id, options)    
execute(command, parameters, options)    
exists(id, options)    
find(filter, options)    
findById(id, filter, options)    
findOne(filter, options)    
replaceById(id, data, options)    
save(entity, options)    
toEntities(models)    
toEntity(model)    
update(entity, options)    
updateAll(data, where, options)    
updateById(id, data, options)