Page Contents

Home > @loopback/repository > ModelDefinition

ModelDefinition class

Definition for a model


export declare class ModelDefinition 


Constructor Modifiers Description
(constructor)(nameOrDef)   Constructs a new instance of the ModelDefinition class


Property Modifiers Type Description
name   string  
properties   {
[name: string]: PropertyDefinition;
relations   RelationDefinitionMap  
settings   {
[name: string]: any;


Method Modifiers Description
addProperty(name, definitionOrType)   Add a property
addRelation(definition)   Define a new relation.
addSetting(name, value)   Add a setting
idProperties()   Get an array of names of ID properties, which are specified in the model settings or properties with id attribute.