Class: EntityModel<T, O>
Models an entity type.
Extends
Type Parameters
Type Parameter | Default type |
---|---|
T extends object | any |
O extends object | any |
Constructors
new EntityModel()
new EntityModel<
T
,O
>(state
:Readonly
<EntityModelState
>):EntityModel
<T
,O
>
Parameters
Parameter | Type |
---|---|
state | Readonly <EntityModelState > |
Returns
EntityModel
<T
, O
>
Overrides
Defined in
packages/verse-core/src/model/model.ts:527
Accessors
allProperties
get
allProperties():List
<PropertyModel
>
Returns
List
<PropertyModel
>
Overrides
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
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
Defined in
packages/verse-core/src/model/model.ts:380
navigations
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
The parent model element.
Inherited from
Defined in
packages/verse-core/src/model/model.ts:477
properties
get
properties():List
<PropertyModel
>
Returns
List
<PropertyModel
>
Inherited from
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
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
Overrides
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
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 Parameter | Default type |
---|---|
T | - |
S | unknown |
Parameters
Parameter | Type | Description |
---|---|---|
visitor | ModelVisitor <T , S > | The visitor to accept. |
state ? | S | An optional state to pass to the visitor. |
Returns
T
The result of visiting this model element.
Overrides
Defined in
packages/verse-core/src/model/model.ts:720
condition()
condition(
name
:string
):Condition
Parameters
Parameter | Type |
---|---|
name | string |
Returns
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
Parameter | Type | Description |
---|---|---|
other | unknown | The object to compare with. |
Returns
boolean
Whether the objects are equal or not.
Overrides
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
Defined in
packages/verse-core/src/model/model.ts:747
navigation()
navigation(
name
:string
):NavigationPropertyModel
Parameters
Parameter | Type |
---|---|
name | string |
Returns
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
Parameter | Type | Description |
---|---|---|
rewriter | ModelRewriter | The rewriter to use for rewriting the model. |
Returns
EntityModel
<T
, O
>
The rewritten model.
Overrides
Defined in
packages/verse-core/src/model/model.ts:724
scalar()
scalar(
name
:string
):ScalarPropertyModel
Parameters
Parameter | Type |
---|---|
name | string |
Returns
Inherited from
Defined in
packages/verse-core/src/model/model.ts:441
scalarFlatMap()
scalarFlatMap<
T
>(action
: (path
:ScalarPropertyPath
) =>T
):List
<T
>
Type Parameters
Type Parameter | Default type |
---|---|
T | ScalarPropertyPath |
Parameters
Parameter | Type |
---|---|
action | (path : ScalarPropertyPath ) => T |
Returns
List
<T
>
Inherited from
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
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
Defined in
packages/verse-core/src/model/model.ts:707
withConcurrency()
withConcurrency(
concurrency
:ConcurrencyModel
):EntityModel
<any
,any
>
Parameters
Parameter | Type |
---|---|
concurrency | ConcurrencyModel |
Returns
EntityModel
<any
, any
>
Defined in
packages/verse-core/src/model/model.ts:669
withCondition()
withCondition(
condition
:Condition
):EntityModel
<any
,any
>
Parameters
Parameter | Type |
---|---|
condition | Condition |
Returns
EntityModel
<any
, any
>
Defined in
packages/verse-core/src/model/model.ts:655
withForeignKey()
withForeignKey(
foreignKey
:ForeignKeyModel
):EntityModel
<any
,any
>
Parameters
Parameter | Type |
---|---|
foreignKey | ForeignKeyModel |
Returns
EntityModel
<any
, any
>
Defined in
packages/verse-core/src/model/model.ts:599
withKey()
withKey(
key
:KeyModel
):EntityModel
<any
,any
>
Parameters
Parameter | Type |
---|---|
key | KeyModel |
Returns
EntityModel
<any
, any
>
Defined in
packages/verse-core/src/model/model.ts:567
withLabel()
withLabel(
label
:string
):EntityModel
<any
,any
>
Parameters
Parameter | Type |
---|---|
label | string |
Returns
EntityModel
<any
, any
>
Defined in
packages/verse-core/src/model/model.ts:535
withName()
withName(
name
:string
):any
Parameters
Parameter | Type |
---|---|
name | string |
Returns
any
Inherited from
Defined in
packages/verse-core/src/model/model.ts:384
withProperties()
protected
withProperties(properties
:List
<PropertyModel
>):EntityModel
<any
,any
>
Parameters
Parameter | Type |
---|---|
properties | List <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
Parameter | Type |
---|---|
property | PropertyModel |
Returns
EntityModel
<T
, any
>
Overrides
Defined in
packages/verse-core/src/model/model.ts:587
withTable()
withTable(
table
:string
):EntityModel
<any
,any
>
Parameters
Parameter | Type |
---|---|
table | string |
Returns
EntityModel
<any
, any
>