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

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Constructors

Properties

AllowAllRowsAPI: boolean = false

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

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

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.
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)

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

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

ID: string = null

Unique identifier for the entity

Icon: string = null

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

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.
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.
TrackRecordChanges: boolean = null

Whether to track all changes to records in the RecordChange table

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

_Fields: EntityFieldInfo[]
_Permissions: EntityPermissionInfo[]
_RelatedEntities: EntityRelationshipInfo[]
_Settings: EntitySettingInfo[]
__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
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

__createdAtFieldName: string = '__mj_CreatedAt'
__deletedAtFieldName: string = '__mj_DeletedAt'
__updatedAtFieldName: string = '__mj_UpdatedAt'

Accessors

  • 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 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 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

  • Generates a where clause for SQL filtering for a given entity for a given user and permission type. If there is no RLS for a given entity or the user is exempt from RLS for the entity, a blank string is returned.

    Parameters

    Returns string

  • 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

  • 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

  • Builds a simple javascript object that will pre-populate a new record in the related entity with values that link back to the specified record. This is useful, for example, when creating a new contact from an account, we want to pre-populate the account ID in the new contact record

    Parameters

    Returns any