Member Junction
    Preparing search index...

    Catalog of all entities across all schemas. Contains comprehensive metadata about each entity including its database mappings, security settings, and UI preferences.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    __mj_CreatedAt: Date = null

    Date and time when this entity was created

    __mj_UpdatedAt: Date = null

    Date and time when this entity was last updated

    _floatCount: number = 0
    _hasIdField: boolean = false
    _manyToManyCount: number = 0
    _oneToManyCount: number = 0
    _virtualCount: number = 0
    AllowAllRowsAPI: boolean = false

    If true, allows querying all rows without pagination limits via API

    AllowCaching: boolean = false

    Controls whether this entity participates in server-side and client-side caching at all. When false (default for non-__mj entities), the entire cache code path is short-circuited: no PreRunView cache check, no auto-cache storage, no HandleBaseEntityEvent fingerprint scan, no client-side IndexedDB cache. Zero overhead on hot save/query paths.

    AllowCreateAPI: boolean = false

    Global flag controlling whether records can be created via API

    AllowDeleteAPI: boolean = false

    Global flag controlling whether records can be deleted via API

    AllowMultipleSubtypes: boolean = false

    When false (default), child types are disjoint — a record can only be one child type at a time. When true, a record can simultaneously exist as multiple child types (e.g., a Person can be both a Member and a Volunteer). This flag is set on the parent entity and controls whether its children are exclusive.

    AllowRecordMerge: boolean = null

    Whether records in this entity can be merged together

    AllowUpdateAPI: boolean = false

    Global flag controlling whether records can be updated via API

    AllowUserSearchAPI: boolean = false

    Whether users can search this entity through the search API

    AuditRecordAccess: boolean = null

    Whether to audit when users access records from this entity

    AuditViewRuns: boolean = null

    Whether to audit when views are run against this entity

    AutoRowCountFrequency: number = null
    • Field Name: AutoRowCountFrequency
    • Display Name: Auto Row Count Frequency
    • SQL Data Type: int
    • Description: Frequency in hours for automatically performing row counts on this entity. If NULL, automatic row counting is disabled. If greater than 0, schedules recurring SELECT COUNT(*) queries at the specified interval.
    AutoUpdateDescription: boolean = true
    • Field Name: AutoUpdateDescription
    • Display Name: Auto Update Description
    • SQL Data Type: bit
    • Default Value: 1
    • Description: When set to 1 (default), whenever a description is modified in the underlying view (first choice) or table (second choice), the Description column in the entity definition will be automatically updated. If you never set metadata in the database directly, you can leave this alone. However, if you have metadata set in the database level for description, and you want to provide a DIFFERENT description in this entity definition, turn this bit off and then set the Description field and future CodeGen runs will NOT override the Description field here.
    AutoUpdateSupportsGeoCoding: boolean = true

    When true (default), CodeGen can automatically set SupportsGeoCoding based on LLM analysis of entity fields. Set to false to lock the value.

    BaseTable: string = null

    The underlying database table name this entity maps to

    BaseTableCodeName: string = null
    BaseView: string = null

    The database view used as a "wrapper" for accessing this entity's data

    BaseViewGenerated: boolean = null

    Whether the base view is generated by CodeGen (true) or manually created (false)

    CanonicalSchemaName: string = null

    Case-stable canonical schema name, sourced from the app manifest (mj-app.json schema.name) and persisted on SchemaInfo. When non-null it is used in place of SchemaName to derive the schema prefix for the entity ClassName/CodeName and GraphQL type name, so PostgreSQL installs (whose physical SchemaName is folded to lowercase) still produce PascalCase prefixes matching the published, hand-cased entity packages. NULL means "no override" -> the prefix falls back to SchemaName (every existing install, the core __mj schema, and SQL Server).

    CascadeDeletes: boolean = null

    Whether to automatically delete related records when a parent is deleted

    ClassName: string = null
    CodeName: string = null

    CodeName is a unique name that can be used for various programatic purposes, singular version of the entity name but modified from entity name in some cases to remove whitespace and prefix with _ in the event that the entity name begins with a number or other non-alpha character

    CustomResolverAPI: boolean = false

    If true, uses a custom resolver for GraphQL operations instead of standard CRUD

    DeleteType: "Hard" | "Soft" = 'Hard'

    Type of delete operation: Hard (physical delete) or Soft (mark as deleted)

    Description: string = null

    Detailed description of the entity's purpose and contents

    DisplayName: string = null

    Optional display name for the entity. If not provided, the entity Name will be used for display purposes.

    EntityObjectSubclassImport: string = null

    Import statement for the entity's TypeScript subclass

    EntityObjectSubclassName: string = null

    Name of the TypeScript subclass for this entity if custom behavior is needed

    ExternalDataSourceID: string = null

    If set, this entity is backed by an external data source (Snowflake, MongoDB, external SQL/PostgreSQL/MySQL, ...) and is read-only. Reads are proxied live through the registered ExternalDataSourceReadRouter. Null = backed by the MJ database.

    ExternalObjectName: string = null

    Remote object name (table/view/collection) on the external system that backs this entity. Resolved against the data source defaults when unqualified. Only meaningful when ExternalDataSourceID is set.

    FullTextCatalog: string = null

    Name of the SQL Server full-text catalog used for searching

    FullTextCatalogGenerated: boolean = true

    Whether the full-text catalog is generated by CodeGen

    FullTextIndex: string = null

    Name of the full-text index on this entity

    FullTextIndexGenerated: boolean = true

    Whether the full-text index is generated by CodeGen

    FullTextSearchEnabled: boolean = false

    Whether full-text search is enabled for this entity

    FullTextSearchFunction: string = null

    Name of the function used for full-text searching

    FullTextSearchFunctionGenerated: boolean = true

    Whether the full-text search function is generated by CodeGen

    Icon: string = null

    CSS class or icon identifier for displaying this entity in the UI

    ID: string = null

    Unique identifier for the entity

    IncludeInAPI: boolean = false

    Whether this entity is available through the GraphQL API

    Name: string = null

    Unique name of the entity used throughout the system

    NameSuffix: string = null

    Optional suffix appended to entity names for display purposes

    ParentBaseTable: string = null
    ParentBaseView: string = null
    ParentEntity: number = null
    ParentID: string = null

    Reserved for future use - parent entity for hierarchical relationships

    PreferredCommunicationField: string = null

    Field name that contains the preferred communication method (email, phone, etc.)

    RelationshipDefaultDisplayType: "Search" | "Dropdown" = null

    Default display type for relationships: Search (type-ahead) or Dropdown

    RowCount: number = null
    • Field Name: RowCount
    • Display Name: Row Count
    • SQL Data Type: bigint
    • Description: Cached row count for this entity, populated by automatic row count processes when AutoRowCountFrequency is configured.
    RowCountRunAt: Date = null
    • Field Name: RowCountRunAt
    • Display Name: Row Count Run At
    • SQL Data Type: datetimeoffset
    • Description: Timestamp indicating when the last automatic row count was performed for this entity.
    RowsToPackSampleCount: number = 0
    • Field Name: RowsToPackSampleCount
    • Display Name: Rows To Pack Sample Count
    • SQL Data Type: int
    • Default Value: 0
    • Description: The number of rows to pack when RowsToPackWithSchema is set to Sample, based on the designated sampling method. Defaults to 0.
    RowsToPackSampleMethod: "random" | "top n" | "bottom n" = 'random'
    • Field Name: RowsToPackSampleMethod
    • Display Name: Rows To Pack Sample Method
    • SQL Data Type: nvarchar(20)
    • Default Value: random
    • Value List Type: List
    • Possible Values
      • random
      • top n
      • bottom n
    • Description: Defines the sampling method for row packing when RowsToPackWithSchema is set to Sample. Options include random, top n, and bottom n. Defaults to random.
    RowsToPackSampleOrder: string = null
    • Field Name: RowsToPackSampleOrder
    • Display Name: Rows To Pack Sample Order
    • SQL Data Type: nvarchar(MAX)
    • Description: An optional ORDER BY clause for row packing when RowsToPackWithSchema is set to Sample. Allows custom ordering for selected entity data when using top n and bottom n.
    RowsToPackWithSchema: "None" | "All" | "Sample" = 'None'
    • Field Name: RowsToPackWithSchema
    • Display Name: Rows To Pack With Schema
    • SQL Data Type: nvarchar(20)
    • Default Value: None
    • Value List Type: List
    • Possible Values
      • None
      • Sample
      • All
    • Description: Determines how entity rows should be packaged for external use. Options include None, Sample, and All. Defaults to None.
    SchemaName: string = null

    Database schema that contains this entity's table and view

    ScopeDefault: string = null
    • Field Name: ScopeDefault
    • Display Name: Scope Default
    • SQL Data Type: nvarchar(100)
    • Description: Optional, comma-delimited string indicating the default scope for entity visibility. Options include Users, Admins, AI, and All. Defaults to All when NULL. This is used for simple defaults for filtering entity visibility, not security enforcement.
    spCreate: string = null

    Name of the stored procedure for creating records

    spCreateGenerated: boolean = null

    Whether the create stored procedure is generated by CodeGen

    spDelete: string = null

    Name of the stored procedure for deleting records

    spDeleteGenerated: boolean = null

    Whether the delete stored procedure is generated by CodeGen

    spMatch: string = null

    Name of the stored procedure used for matching/duplicate detection

    spUpdate: string = null

    Name of the stored procedure for updating records

    spUpdateGenerated: boolean = null

    Whether the update stored procedure is generated by CodeGen

    Status: "Active" | "Disabled" | "Deprecated" = 'Active'
    • Field Name: Status
    • Display Name: Status
    • SQL Data Type: nvarchar(25)
    • Default Value: Active
    • Description: Status of the entity. Active: fully functional; Deprecated: functional but generates console warnings when used; Disabled: not available for use even though metadata and physical table remain.
    SupportsGeoCoding: boolean = false

    When true, this entity supports geocoding — CodeGen generates geo-aware subclass code, adds __mj_Latitude/__mj_Longitude virtual fields to the base view, and the UI shows a map view toggle. Auto-set by CodeGen when LLM detects geo-capable fields.

    TrackRecordChanges: boolean = null

    Whether to track all changes to records in the RecordChange table

    TrustServerCacheCompletely: boolean = true

    When true (default), the server-side RunView cache will store and return cached results for this entity, trusting that all mutations flow through BaseEntity.Save() which fires cache invalidation events. Set to false for entities whose rows are created as side-effects of other operations via raw SQL (e.g., Record Changes created by spCreateRecordChange_Internal), since those inserts bypass BaseEntity and never trigger cache invalidation.

    UserFormGenerated: boolean = null

    Whether the user form for this entity is generated by CodeGen

    UserViewMaxRows: number = null

    Maximum number of rows to return in user views to prevent performance issues

    VirtualEntity: boolean = null

    If true, this is a virtual entity not backed by a physical database table

    Accessors

    • get ChildEntities(): EntityInfo[]

      Returns all child entities that have their ParentID set to this entity's ID. These represent IS-A type specializations of this entity. Example: For "Products" entity, might return [Meetings, Publications].

      When AllowMultipleSubtypes is true on this entity, multiple children can coexist for the same parent record (overlapping subtypes). When false (default), only one child type is allowed per parent record (disjoint subtypes).

      Returns EntityInfo[]

    • get DatetimeFields(): EntityFieldInfo[]

      Returns an array of all fields whose TypeScript type is Date. Cached — used per query by the data providers' row post-processing to convert datetime values; recomputing the scan (and the per-field TSType classification) on every query is wasteful.

      Returns EntityFieldInfo[]

      Array of date/datetime fields

    • get FieldCategories(): Record<string, FieldCategoryInfo>

      Gets the parsed FieldCategoryInfo map for this entity, keyed by category name. Auto-populated from the 'FieldCategoryInfo' EntitySetting (with legacy 'FieldCategoryIcons' fallback) during EntityInfo construction. Returns null if no category info is configured.

      Returns Record<string, FieldCategoryInfo>

    • get FirstPrimaryKey(): EntityFieldInfo

      Returns the primary key field for the entity. For entities with a composite primary key, use the PrimaryKeys property which returns all. In the case of a composite primary key, the PrimaryKey property will return the first field in the sequence of the primary key fields.

      Returns EntityFieldInfo

    • get HasInactiveFields(): boolean

      Returns true if ANY field on this entity is Deprecated or Disabled (i.e. not Active).

      Computed once on first access and cached for the lifetime of this EntityInfo. The value is a property of the entity definition (shared across every record instance), so the common case — an entity whose fields are all Active — is a single cached boolean.

      This is the fast-path gate for active-status enforcement in BaseEntity.Get/Set/SetMany: when it is false those paths skip the per-field status lookup entirely, keeping hot read/write loops free of any deprecation-check overhead.

      Returns boolean

    • get HasOverlappingSubtypes(): boolean

      Convenience alias: returns true when this entity is a parent type that allows overlapping (non-disjoint) subtypes. Equivalent to checking both IsParentType and AllowMultipleSubtypes.

      Returns boolean

    • get NameField(): EntityFieldInfo

      Returns the EntityField object for the Field that has IsNameField set to true. If multiple fields have IsNameField on, the function will return the first field (by sequence) that matches. If no fields match, if there is a field called "Name", that is returned. If there is no field called "Name", null is returned.

      Returns EntityFieldInfo

    • get ParentChain(): EntityInfo[]

      Walks the IS-A chain upward from this entity to the root, returning all parent entities. Does NOT include this entity itself. Example: For Webinars (IS-A Meetings IS-A Products), returns [Meetings, Products]. Results are cached after first computation for performance.

      Returns EntityInfo[]

    • get ParentEntityFieldNames(): Set<string>

      Returns a cached Set of field names that belong to parent entities in the IS-A chain, including the shared primary key(s). Used for efficient field routing in BaseEntity.Set/Get/SetMany/Hydrate operations. The Set enables O(1) lookup to determine if a field should be routed to the parent entity.

      Note: AllParentFields excludes PKs (they aren't "inherited data" fields), but the routing set must include them so that SetMany and Hydrate can forward the shared IS-A primary key to parent entities.

      Returns Set<string>

    • get ParentEntityInfo(): EntityInfo

      Returns the parent EntityInfo for IS-A type inheritance, or null if this entity has no parent type. Uses the existing ParentID column on the Entity table. Example: For "Meetings" entity with ParentID pointing to "Products", returns the Products EntityInfo.

      Returns EntityInfo

    • get CreatedAtFieldName(): string

      Returns the name of the special reserved field that is used to store the CreatedAt timestamp across all of MJ. This is only used when an entity has TrackRecordChanges turned on

      Returns string

    • get DeletedAtFieldName(): string

      Returns the name of the special reserved field that is used to store the DeletedAt timestamp across all of MJ. This is only used when an entity has DeleteType=Soft

      Returns string

    • get UpdatedAtFieldName(): string

      Returns the name of the special reserved field that is used to store the UpdatedAt timestamp across all of MJ. This is only used when an entity has TrackRecordChanges turned on

      Returns string

    Methods

    • Copies initialization data from a plain object to the class instance. Only copies properties that already exist on the class to prevent creating new fields. Special handling for DefaultValue fields to extract actual values from SQL Server syntax.

      Parameters

      • initData: any

        The initialization data object

      Returns void

    • O(1) case-insensitive field lookup by name. Use this instead of Fields.find(f => f.Name === name) on hot paths — it builds a lowercased+trimmed Map once (lazily) and reuses it.

      NOTE: this is a field-within-entity index, distinct from the entity-level "Map-backed entity lookups" that were evaluated and skipped (~500 entities, negligible). Here a single entity can be read field-by-field in tight loops, so the index is worthwhile.

      Parameters

      • name: string

        field name (matched case-insensitively, whitespace-trimmed)

      Returns EntityFieldInfo

      the matching EntityFieldInfo, or undefined if not found

    • Returns the Permissions for this entity for a given user, based on the roles the user is part of.

      Allow rows are OR-aggregated across all of the user's matching roles; any single Allow on an action yields permission for that action. Deny rows from any matching role then subtract from the aggregated Allow set — so a Deny on CanDelete overrides a Delete grant that the user otherwise has from another role. This lets administrators carve out specific role exclusions without restructuring the Allow hierarchy. Rows with a missing/unknown Type default to Allow for backwards compatibility with data written before the Type column existed (Phase 2b).

      Parameters

      Returns EntityUserPermissionInfo

    • Default JSON serialization for BaseInfo subclasses.

      Emits all non-underscored direct field declarations. For _-prefixed private backing fields (the MJ pattern for collection storage — e.g. _Fields, _RelatedEntities, _OrganicKeys), emits the value of the corresponding same-named public getter instead. Purely computed getters without a backing field (display-name formatters, derived flags) are intentionally skipped — they can throw when source fields are null and don't belong on the wire anyway.

      Nested BaseInfo instances and arrays of them unwrap automatically via JSON.stringify's native toJSON() protocol.

      Subclasses may override to emit a filtered subset or custom shape (see EntityFieldValueInfo).

      Returns Record<string, unknown>

    • This static factory method is used to check to see if the entity in question is active or not If it is not active, it will throw an exception or log a warning depending on the status of the entity being either Deprecated or Disabled.

      Parameters

      • entity: EntityInfo

        the EntityInfo object to check the status of

      • callerName: string

        the name of the caller that is calling this method, used for logging purposes such as BaseEntity::constructor as an example.

      Returns void