@loopback/docs
Version:
Documentation for LoopBack 4
33 lines (22 loc) • 1.21 kB
Markdown
lang: en
title: 'API docs: repository.entity'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.entity.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository](./repository.md) > [Entity](./repository.entity.md)
## Entity class
Base class for entities which have unique ids
<b>Signature:</b>
```typescript
export declare abstract class Entity extends Model implements Persistable
```
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [buildWhereForId(id)](./repository.entity.buildwhereforid.md) | <code>static</code> | Build the where object for the given id |
| [getId()](./repository.entity.getid.md) | | Get the identity value. If the identity is a composite key, returns an object. |
| [getIdObject()](./repository.entity.getidobject.md) | | Get the identity as an object, such as <code>{id: 1}</code> or <code>{schoolId: 1, studentId: 2}</code> |
| [getIdOf(entityOrData)](./repository.entity.getidof.md) | <code>static</code> | Get the identity value for a given entity instance or entity data object. |