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

## DefaultHasOneRepository class

<b>Signature:</b>

```typescript
export declare class DefaultHasOneRepository<TargetEntity extends Entity, TargetID, TargetRepository extends EntityCrudRepository<TargetEntity, TargetID>> implements HasOneRepository<TargetEntity> 
```
<b>Implements:</b> [HasOneRepository](./repository.hasonerepository.md)

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(getTargetRepository, constraint, targetResolver)](./repository.defaulthasonerepository._constructor_.md) |  | Constructor of DefaultHasOneEntityCrudRepository |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [constraint](./repository.defaulthasonerepository.constraint.md) |  | [DataObject](./repository.dataobject.md)<!-- -->&lt;TargetEntity&gt; |  |
|  [getTargetRepository](./repository.defaulthasonerepository.gettargetrepository.md) |  | [Getter](./context.getter.md)<!-- -->&lt;TargetRepository&gt; \| { \[repoType: string\]: [Getter](./context.getter.md)<!-- -->&lt;TargetRepository&gt;; } |  |
|  [getTargetRepositoryDict](./repository.defaulthasonerepository.gettargetrepositorydict.md) |  | { \[repoType: string\]: [Getter](./context.getter.md)<!-- -->&lt;TargetRepository&gt;; } |  |
|  [targetResolver](./repository.defaulthasonerepository.targetresolver.md) |  | [TypeResolver](./repository.typeresolver.md)<!-- -->&lt;[Entity](./repository.entity.md)<!-- -->, typeof [Entity](./repository.entity.md)<!-- -->&gt; |  |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [create(targetModelData, options)](./repository.defaulthasonerepository.create.md) |  |  |
|  [delete(options)](./repository.defaulthasonerepository.delete.md) |  |  |
|  [get(filter, options)](./repository.defaulthasonerepository.get.md) |  |  |
|  [patch(dataObject, options)](./repository.defaulthasonerepository.patch.md) |  |  |


