---
lang: en
title: 'API docs: repository.defaulthasmanythroughrepository'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.defaulthasmanythroughrepository.html
---

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [DefaultHasManyThroughRepository](./repository.defaulthasmanythroughrepository.md)

## DefaultHasManyThroughRepository class

a class for CRUD operations for hasManyThrough relation.

Warning: The hasManyThrough interface is experimental and is subject to change. If backwards-incompatible changes are made, a new major version may not be released.

**Signature:**

```typescript
export declare class DefaultHasManyThroughRepository<TargetEntity extends Entity, TargetID, TargetRepository extends EntityCrudRepository<TargetEntity, TargetID>, ThroughEntity extends Entity, ThroughID, ThroughRepository extends EntityCrudRepository<ThroughEntity, ThroughID>> implements HasManyThroughRepository<TargetEntity, TargetID, ThroughEntity> 
```
**Implements:** [HasManyThroughRepository](./repository.hasmanythroughrepository.md)<!-- -->&lt;TargetEntity, TargetID, ThroughEntity&gt;

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(getTargetRepository, getThroughRepository, getTargetConstraintFromThroughModels, getTargetKeys, getThroughConstraintFromSource, getTargetIds, getThroughConstraintFromTarget, targetResolver, throughResolver)](./repository.defaulthasmanythroughrepository._constructor_.md) |  | Constructs a new instance of the <code>DefaultHasManyThroughRepository</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [getTargetConstraintFromThroughModels](./repository.defaulthasmanythroughrepository.gettargetconstraintfromthroughmodels.md) |  | (throughInstances: ThroughEntity\[\]) =&gt; [DataObject](./repository.dataobject.md)<!-- -->&lt;TargetEntity&gt; |  |
|  [getTargetIds](./repository.defaulthasmanythroughrepository.gettargetids.md) |  | (targetInstances: TargetEntity\[\]) =&gt; TargetID\[\] |  |
|  [getTargetKeys](./repository.defaulthasmanythroughrepository.gettargetkeys.md) |  | (throughInstances: ThroughEntity\[\]) =&gt; TargetID\[\] |  |
|  [getTargetRepository](./repository.defaulthasmanythroughrepository.gettargetrepository.md) |  | Getter&lt;TargetRepository&gt; \| { \[repoType: string\]: Getter&lt;TargetRepository&gt;; } |  |
|  [getTargetRepositoryDict](./repository.defaulthasmanythroughrepository.gettargetrepositorydict.md) |  | { \[repoType: string\]: Getter&lt;TargetRepository&gt;; } |  |
|  [getThroughConstraintFromSource](./repository.defaulthasmanythroughrepository.getthroughconstraintfromsource.md) |  | () =&gt; [DataObject](./repository.dataobject.md)<!-- -->&lt;ThroughEntity&gt; |  |
|  [getThroughConstraintFromTarget](./repository.defaulthasmanythroughrepository.getthroughconstraintfromtarget.md) |  | (targetID: TargetID\[\]) =&gt; [DataObject](./repository.dataobject.md)<!-- -->&lt;ThroughEntity&gt; |  |
|  [getThroughRepository](./repository.defaulthasmanythroughrepository.getthroughrepository.md) |  | Getter&lt;ThroughRepository&gt; |  |
|  [targetResolver](./repository.defaulthasmanythroughrepository.targetresolver.md) |  | [TypeResolver](./repository.typeresolver.md)<!-- -->&lt;[Entity](./repository.entity.md)<!-- -->, typeof [Entity](./repository.entity.md)<!-- -->&gt; |  |
|  [throughResolver](./repository.defaulthasmanythroughrepository.throughresolver.md) |  | [TypeResolver](./repository.typeresolver.md)<!-- -->&lt;[Entity](./repository.entity.md)<!-- -->, typeof [Entity](./repository.entity.md)<!-- -->&gt; |  |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [create(targetModelData, options)](./repository.defaulthasmanythroughrepository.create.md) |  |  |
|  [delete(where, options)](./repository.defaulthasmanythroughrepository.delete.md) |  |  |
|  [find(filter, options)](./repository.defaulthasmanythroughrepository.find.md) |  |  |
|  [link(targetId, options)](./repository.defaulthasmanythroughrepository.link.md) |  |  |
|  [patch(dataObject, where, options)](./repository.defaulthasmanythroughrepository.patch.md) |  |  |
|  [unlink(targetId, options)](./repository.defaulthasmanythroughrepository.unlink.md) |  |  |
|  [unlinkAll(options)](./repository.defaulthasmanythroughrepository.unlinkall.md) |  |  |


