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

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [DefaultHasManyRepository](./repository.defaulthasmanyrepository.md) &gt; [(constructor)](./repository.defaulthasmanyrepository._constructor_.md)

## DefaultHasManyRepository.(constructor)

Constructor of DefaultHasManyEntityCrudRepository

<b>Signature:</b>

```typescript
constructor(getTargetRepository: Getter<TargetRepository>, constraint: DataObject<TargetEntity>);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  getTargetRepository | [Getter](./context.getter.md)<!-- -->&lt;TargetRepository&gt; | the getter of the related target model repository instance |
|  constraint | [DataObject](./repository.dataobject.md)<!-- -->&lt;TargetEntity&gt; | the key value pair representing foreign key name to constrain the target repository instance |


