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

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

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

## DefaultHasOneRepository._constructor_

Constructor of DefaultHasOneEntityCrudRepository

<b>Signature:</b>

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

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  getTargetRepository | <code>Getter&lt;TargetRepository&gt;</code> | the getter of the related target model repository instance |
|  constraint | <code>DataObject&lt;TargetEntity&gt;</code> | the key value pair representing foreign key name to constrain the target repository instance |


