---
lang: en
title: 'API docs: repository.createhasmanythroughrepositoryfactory'
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.createhasmanythroughrepositoryfactory.html
---

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [createHasManyThroughRepositoryFactory](./repository.createhasmanythroughrepositoryfactory.md)

## createHasManyThroughRepositoryFactory() function

<b>Signature:</b>

```typescript
export declare function createHasManyThroughRepositoryFactory<Target extends Entity, TargetID, Through extends Entity, ThroughID, SourceID>(relationMetadata: HasManyDefinition, targetRepositoryGetter: Getter<EntityCrudRepository<Target, TargetID>>, throughRepositoryGetter: Getter<EntityCrudRepository<Through, ThroughID>>): HasManyThroughRepositoryFactory<Target, TargetID, Through, SourceID>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  relationMetadata | [HasManyDefinition](./repository.hasmanydefinition.md) |  |
|  targetRepositoryGetter | [Getter](./context.getter.md)<!-- -->&lt;[EntityCrudRepository](./repository.entitycrudrepository.md)<!-- -->&lt;Target, TargetID&gt;&gt; |  |
|  throughRepositoryGetter | [Getter](./context.getter.md)<!-- -->&lt;[EntityCrudRepository](./repository.entitycrudrepository.md)<!-- -->&lt;Through, ThroughID&gt;&gt; |  |

<b>Returns:</b>

[HasManyThroughRepositoryFactory](./repository.hasmanythroughrepositoryfactory.md)<!-- -->&lt;Target, TargetID, Through, SourceID&gt;


