Page Contents

Home > @loopback/repository > Entity

Entity class

Base class for entities which have unique ids

Signature:

export declare abstract class Entity extends Model implements Persistable 

Methods

Method Modifiers Description
buildWhereForId(id) static Build the where object for the given id
getId()   Get the identity value. If the identity is a composite key, returns an object.
getIdObject()   Get the identity as an object, such as {id: 1} or {schoolId: 1, studentId: 2}
getIdOf(entityOrData) static Get the identity value for a given entity instance or entity data object.
getIdProperties() static Get the names of identity properties (primary keys).