Class ReflectionClass<T>

Reflection

never

Type Parameters

  • T

Hierarchy

  • ReflectionClass

Constructors

Properties

assignedSingleTableInheritanceSubClassesByIdentifier?: {
    [id: string]: ReflectionClass<any>;
}

Type declaration

autoIncrements: ReflectionProperty[] = []
collectionName?: string

The collection name, used in database context (also known as table name).

Usually, if this is not set, name will be used.

@entity.collection('users').name('user')
class User {

}
data: {
    [name: string]: any;
} = {}

A place where arbitrary data is stored, usually set via decorator t.data.

Type declaration

  • [name: string]: any
databaseSchemaName?: string
description: string = ''

The description, extracted from the class JSDoc @description.

disableConstructor: boolean = false
indexes: {
    names: string[];
    options: IndexOptions;
}[] = []

Contains all indexed, multi-field using entity.index and all indexes from properties.

@entity
.collection('users')
.name('user')
.index(['username', 'email'])
.index(['email', 'region'], {unique: true})
class User {
username: string;
email: string;
}
methodNames: string[] = []
methods: ReflectionMethod[] = []
name?: string

The unique entity name.

@entity.name('user')
class User {

}
parent?: ReflectionClass<any>
primaries: ReflectionProperty[] = []
properties: ReflectionProperty[] = []
propertyNames: string[] = []
references: ReflectionProperty[] = []

References and back references.

singleTableInheritance: boolean = false

True when @entity.singleTableInheritance was set.

subClasses: ReflectionClass<any>[] = []

A class using @t.singleTableInheritance registers itself in this array in its super class.

validationMethod?: string | number | symbol | TypeTemplateLiteral

If a custom validator method was set via @t.validator, then this is the method name.

Methods

  • All references have a counter-part. This methods finds it and errors if not possible.

    If the given reference is a owning reference it finds the correct backReference, which can be found by checking all reference options.mappedBy.

    If the given reference is a back reference it finds the owning reference, which can be found by using its options.mappedBy.

    Alternatively we simply check for resolvedClassType to be given classType, and if only one found, we return it. When more than one found, we throw an error saying the user he should make its relation mapping not ambiguous.

    Parameters

    Returns ReflectionProperty

Generated using TypeDoc