---
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.

<b>Signature:</b>

```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> 
```
<b>Implements:</b> [HasManyThroughRepository](./repository.hasmanythroughrepository.md)<!-- -->&lt;TargetEntity, TargetID, ThroughEntity&gt;

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(getTargetRepository, getThroughRepository, getTargetConstraintFromThroughModels, getTargetKeys, getThroughConstraintFromSource, getTargetIds, getThroughConstraintFromTarget)](./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](./context.getter.md)<!-- -->&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](./context.getter.md)<!-- -->&lt;ThroughRepository&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) |  |  |


