Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface EntityMapping

Represents the mapping from a document collection to a named class type.

Hierarchy

Index

Properties

changeTracking

changeTracking: ChangeTrackingType

The change tracking to use for this entity. If not specified, the change tracking type specified in the Configuration is used.

classConstructor

classConstructor: Function

The constructor for the class.

collectionName

collectionName: string

The database collection name. If not specified, the naming strategy specified in the Configuration is used to determine the collection name.

collectionOptions

collectionOptions: CollectionOptions

Options to pass to the database when creating the collection.

databaseName

databaseName: string

The name of the database. If not specified, the default database for the connection is used.

discriminatorField

discriminatorField: string

The database document field to use to represent the type of the class. If not specified, the field name from the Configuration is used. Only valid on the root mapping of an inheritance hierarchy.

discriminatorValue

discriminatorValue: string

Readonly property gets the value used to represent the class type in the database document.

flags

Readonly flags that describe the mapping. This value is assigned internally and should not be modified.

flushPriority

flushPriority: FlushPriority

The order in which collections are flushed to the database. Higher priority collections are flushed first.

hasBaseClass

hasBaseClass: boolean

Readonly property indicates if this class mapping has a base class.

hasSubClasses

hasSubClasses: boolean

Readonly property indicates if this class mapping has derived classes.

identity

The IdentityGenerator to use for this collection. If not specified, the IdentityGenerator specified in the Configuration is used.

indexes

indexes: Index[]

A list of indexes to optionally create for the collection on startup.

name

name: string

The name of the class.

versionField

versionField: string

The name of the database document field to use to store the version of the entity. If not specified the value from the Configuration is used.

versioned

versioned: boolean

Indicates if this entity should use optimistic locking. Default is true.

Methods

addIndex

  • addIndex(index: Index): void
  • Adds a specification for an index that should be created on the collection. The index is only created if creation of indexes is enabled.

    Parameters

    • index: Index

      The index specification.

    Returns void

addProperty

getProperty

hasFlags

setDiscriminatorValue

  • setDiscriminatorValue(value: string): void
  • Sets the value used to represent the class type in the database document. If not specified, the naming strategy in the Configuration is used to determine the discriminator value based on the class name.

    Parameters

    • value: string

      The value to use for the discriminator for this class.

    Returns void

validateProperty

  • validateProperty(property: Property): string

Generated using TypeDoc