---
lang: en
title: 'API docs: repository.defaultcrudrepository'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.defaultcrudrepository.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [DefaultCrudRepository](./repository.defaultcrudrepository.md)

## DefaultCrudRepository class

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

<b>Signature:</b>

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

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(entityClass, dataSource)](./repository.defaultcrudrepository._constructor_.md) |  | Constructor of DefaultCrudRepository |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [dataSource](./repository.defaultcrudrepository.datasource.md) |  | <code>juggler.DataSource</code> |  |
|  [entityClass](./repository.defaultcrudrepository.entityclass.md) |  | <code>typeof Entity &amp; {</code><br/><code>        prototype: T;</code><br/><code>    }</code> |  |
|  [inclusionResolvers](./repository.defaultcrudrepository.inclusionresolvers.md) |  | <code>Map&lt;string, InclusionResolver&lt;T, Entity&gt;&gt;</code> |  |
|  [modelClass](./repository.defaultcrudrepository.modelclass.md) |  | <code>juggler.PersistedModelClass</code> |  |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [\_createBelongsToAccessorFor(relationName, targetRepoGetter)](./repository.defaultcrudrepository._createbelongstoaccessorfor.md) |  |  |
|  [\_createHasManyRepositoryFactoryFor(relationName, targetRepoGetter)](./repository.defaultcrudrepository._createhasmanyrepositoryfactoryfor.md) |  |  |
|  [\_createHasOneRepositoryFactoryFor(relationName, targetRepoGetter)](./repository.defaultcrudrepository._createhasonerepositoryfactoryfor.md) |  |  |
|  [count(where, options)](./repository.defaultcrudrepository.count.md) |  |  |
|  [create(entity, options)](./repository.defaultcrudrepository.create.md) |  |  |
|  [createAll(entities, options)](./repository.defaultcrudrepository.createall.md) |  |  |
|  [createBelongsToAccessorFor(relationName, targetRepoGetter)](./repository.defaultcrudrepository.createbelongstoaccessorfor.md) |  | Function to create a belongs to accessor |
|  [createHasManyRepositoryFactoryFor(relationName, targetRepoGetter)](./repository.defaultcrudrepository.createhasmanyrepositoryfactoryfor.md) |  | Function to create a constrained relation repository factory |
|  [createHasOneRepositoryFactoryFor(relationName, targetRepoGetter)](./repository.defaultcrudrepository.createhasonerepositoryfactoryfor.md) |  | Function to create a constrained hasOne relation repository factory |
|  [delete(entity, options)](./repository.defaultcrudrepository.delete.md) |  |  |
|  [deleteAll(where, options)](./repository.defaultcrudrepository.deleteall.md) |  |  |
|  [deleteById(id, options)](./repository.defaultcrudrepository.deletebyid.md) |  |  |
|  [execute(command, parameters, options)](./repository.defaultcrudrepository.execute.md) |  |  |
|  [exists(id, options)](./repository.defaultcrudrepository.exists.md) |  |  |
|  [find(filter, options)](./repository.defaultcrudrepository.find.md) |  |  |
|  [findById(id, filter, options)](./repository.defaultcrudrepository.findbyid.md) |  |  |
|  [findOne(filter, options)](./repository.defaultcrudrepository.findone.md) |  |  |
|  [replaceById(id, data, options)](./repository.defaultcrudrepository.replacebyid.md) |  |  |
|  [save(entity, options)](./repository.defaultcrudrepository.save.md) |  |  |
|  [toEntities(models)](./repository.defaultcrudrepository.toentities.md) |  |  |
|  [toEntity(model)](./repository.defaultcrudrepository.toentity.md) |  |  |
|  [update(entity, options)](./repository.defaultcrudrepository.update.md) |  |  |
|  [updateAll(data, where, options)](./repository.defaultcrudrepository.updateall.md) |  |  |
|  [updateById(id, data, options)](./repository.defaultcrudrepository.updatebyid.md) |  |  |


