Skip to main content

Class: EntityModel<T, O>

Models an entity type.

Extends

Type Parameters

Type ParameterDefault type
T extends objectany
O extends objectany

Constructors

new EntityModel()

new EntityModel<T, O>(state: Readonly<EntityModelState>): EntityModel<T, O>

Parameters

ParameterType
stateReadonly<EntityModelState>

Returns

EntityModel<T, O>

Overrides

StructuralModel.constructor

Defined in

packages/verse-core/src/model/model.ts:527

Accessors

allProperties

get allProperties(): List<PropertyModel>

Returns

List<PropertyModel>

Overrides

StructuralModel.allProperties

Defined in

packages/verse-core/src/model/model.ts:563


base

get base(): undefined | EntityModel<any, any>

Returns

undefined | EntityModel<any, any>

Defined in

packages/verse-core/src/model/model.ts:543


concurrency

get concurrency(): undefined | ConcurrencyModel

Returns

undefined | ConcurrencyModel

Defined in

packages/verse-core/src/model/model.ts:665


conditions

get conditions(): List<Condition>

Returns

List<Condition>

Defined in

packages/verse-core/src/model/model.ts:641


data

get data(): undefined | List<object>

Returns

undefined | List<object>

Defined in

packages/verse-core/src/model/model.ts:677


dependents

get dependents(): List<ForeignKeyModel>

Returns

List<ForeignKeyModel>

Defined in

packages/verse-core/src/model/model.ts:681


derived

get derived(): List<EntityModel<any, any>>

Returns

List<EntityModel<any, any>>

Defined in

packages/verse-core/src/model/model.ts:555


foreignKeys

get foreignKeys(): List<ForeignKeyModel>

Returns

List<ForeignKeyModel>

Defined in

packages/verse-core/src/model/model.ts:595


isRoot

get isRoot(): boolean

Returns

boolean

Defined in

packages/verse-core/src/model/model.ts:551


key

get key(): undefined | KeyModel

Returns

undefined | KeyModel

Defined in

packages/verse-core/src/model/model.ts:559


klass

get klass(): Newable<unknown>

Returns

Newable<unknown>

Inherited from

StructuralModel.klass

Defined in

packages/verse-core/src/model/model.ts:393


label

get label(): string

Returns

string

Defined in

packages/verse-core/src/model/model.ts:531


name

get name(): string

Returns

string

Inherited from

StructuralModel.name

Defined in

packages/verse-core/src/model/model.ts:380


get navigations(): List<NavigationPropertyModel>

Returns

List<NavigationPropertyModel>

Defined in

packages/verse-core/src/model/model.ts:609


parent

get parent(): Model

Returns the parent model element.

Returns

Model

The parent model element.

Inherited from

StructuralModel.parent

Defined in

packages/verse-core/src/model/model.ts:477


properties

get properties(): List<PropertyModel>

Returns

List<PropertyModel>

Inherited from

StructuralModel.properties

Defined in

packages/verse-core/src/model/model.ts:397


root

get root(): EntityModel<any, any>

Returns

EntityModel<any, any>

Defined in

packages/verse-core/src/model/model.ts:547


scalars

get scalars(): List<ScalarPropertyModel>

Returns

List<ScalarPropertyModel>

Inherited from

StructuralModel.scalars

Defined in

packages/verse-core/src/model/model.ts:425


scalarsAndValues

get scalarsAndValues(): List<ScalarPropertyModel | ValueObjectPropertyModel>

Returns

List<ScalarPropertyModel | ValueObjectPropertyModel>

Inherited from

StructuralModel.scalarsAndValues

Defined in

packages/verse-core/src/model/model.ts:437


state

get protected state(): EntityModelState

Returns

EntityModelState

Overrides

StructuralModel.state

Defined in

packages/verse-core/src/model/model.ts:703


table

get table(): undefined | string

Returns

undefined | string

Defined in

packages/verse-core/src/model/model.ts:625


values

get values(): List<ValueObjectPropertyModel>

Returns

List<ValueObjectPropertyModel>

Inherited from

StructuralModel.values

Defined in

packages/verse-core/src/model/model.ts:431

Methods

accept()

accept<T, S>(visitor: ModelVisitor<T, S>, state?: S): T

Accepts a visitor and returns the result of visiting this model element.

Type Parameters

Type ParameterDefault type
T-
Sunknown

Parameters

ParameterTypeDescription
visitorModelVisitor<T, S>The visitor to accept.
state?SAn optional state to pass to the visitor.

Returns

T

The result of visiting this model element.

Overrides

StructuralModel.accept

Defined in

packages/verse-core/src/model/model.ts:720


condition()

condition(name: string): Condition

Parameters

ParameterType
namestring

Returns

Condition

Defined in

packages/verse-core/src/model/model.ts:645


equals()

equals(other: unknown): boolean

Checks if the current object is equal to the provided object.

Parameters

ParameterTypeDescription
otherunknownThe object to compare with.

Returns

boolean

Whether the objects are equal or not.

Overrides

StructuralModel.equals

Defined in

packages/verse-core/src/model/model.ts:734


hashCode()

hashCode(): number

Returns the hash code of this object.

Returns

number

The hash code.

Overrides

StructuralModel.hashCode

Defined in

packages/verse-core/src/model/model.ts:747


navigation(name: string): NavigationPropertyModel

Parameters

ParameterType
namestring

Returns

NavigationPropertyModel

Defined in

packages/verse-core/src/model/model.ts:615


rewrite()

rewrite(rewriter: ModelRewriter): EntityModel<T, O>

Rewrite method for processing a given model with a rewriter.

Parameters

ParameterTypeDescription
rewriterModelRewriterThe rewriter to use for rewriting the model.

Returns

EntityModel<T, O>

The rewritten model.

Overrides

StructuralModel.rewrite

Defined in

packages/verse-core/src/model/model.ts:724


scalar()

scalar(name: string): ScalarPropertyModel

Parameters

ParameterType
namestring

Returns

ScalarPropertyModel

Inherited from

StructuralModel.scalar

Defined in

packages/verse-core/src/model/model.ts:441


scalarFlatMap()

scalarFlatMap<T>(action: (path: ScalarPropertyPath) => T): List<T>

Type Parameters

Type ParameterDefault type
TScalarPropertyPath

Parameters

ParameterType
action(path: ScalarPropertyPath) => T

Returns

List<T>

Inherited from

StructuralModel.scalarFlatMap

Defined in

packages/verse-core/src/model/model.ts:451


toJSON()

toJSON(): string

Returns a JSON representation of this model element.

Returns

string

The JSON representation.

Inherited from

StructuralModel.toJSON

Defined in

packages/verse-core/src/model/model.ts:82


toObject()

toObject(): {concurrency: undefined | {version: string; };conditions: Condition[];data: undefined | List<object>;foreignKeys: {onDelete: undefined | OnDelete;properties: string[];references: string; }[];key: undefined | string[];label: string;name: string;properties: object[];table: undefined | string; }

Returns this instance as a plain object.

Returns

{concurrency: undefined | {version: string; };conditions: Condition[];data: undefined | List<object>;foreignKeys: {onDelete: undefined | OnDelete;properties: string[];references: string; }[];key: undefined | string[];label: string;name: string;properties: object[];table: undefined | string; }

The plain object.

concurrency

concurrency: undefined | {version: string; }

conditions

conditions: Condition[]

data

data: undefined | List<object>

foreignKeys

foreignKeys: {onDelete: undefined | OnDelete;properties: string[];references: string; }[]

key

key: undefined | string[]

label

label: string

name

name: string

properties

properties: object[]

table

table: undefined | string

Overrides

StructuralModel.toObject

Defined in

packages/verse-core/src/model/model.ts:707


withConcurrency()

withConcurrency(concurrency: ConcurrencyModel): EntityModel<any, any>

Parameters

ParameterType
concurrencyConcurrencyModel

Returns

EntityModel<any, any>

Defined in

packages/verse-core/src/model/model.ts:669


withCondition()

withCondition(condition: Condition): EntityModel<any, any>

Parameters

ParameterType
conditionCondition

Returns

EntityModel<any, any>

Defined in

packages/verse-core/src/model/model.ts:655


withForeignKey()

withForeignKey(foreignKey: ForeignKeyModel): EntityModel<any, any>

Parameters

ParameterType
foreignKeyForeignKeyModel

Returns

EntityModel<any, any>

Defined in

packages/verse-core/src/model/model.ts:599


withKey()

withKey(key: KeyModel): EntityModel<any, any>

Parameters

ParameterType
keyKeyModel

Returns

EntityModel<any, any>

Defined in

packages/verse-core/src/model/model.ts:567


withLabel()

withLabel(label: string): EntityModel<any, any>

Parameters

ParameterType
labelstring

Returns

EntityModel<any, any>

Defined in

packages/verse-core/src/model/model.ts:535


withName()

withName(name: string): any

Parameters

ParameterType
namestring

Returns

any

Inherited from

StructuralModel.withName

Defined in

packages/verse-core/src/model/model.ts:384


withProperties()

protected withProperties(properties: List<PropertyModel>): EntityModel<any, any>

Parameters

ParameterType
propertiesList<PropertyModel>

Returns

EntityModel<any, any>

Overrides

StructuralModel.withProperties

Defined in

packages/verse-core/src/model/model.ts:591


withProperty()

withProperty(property: PropertyModel): EntityModel<T, any>

Parameters

ParameterType
propertyPropertyModel

Returns

EntityModel<T, any>

Overrides

StructuralModel.withProperty

Defined in

packages/verse-core/src/model/model.ts:587


withTable()

withTable(table: string): EntityModel<any, any>

Parameters

ParameterType
tablestring

Returns

EntityModel<any, any>

Defined in

packages/verse-core/src/model/model.ts:629