Member Junction
    Preparing search index...

    Class BaseEnginePropertyConfig

    Property configuration for the BaseEngine class to automatically load/set properties on the class.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    AddToObject?: boolean

    Optional, whether to add the result to the object, defaults to true if not specified

    AutoRefresh?: boolean = true

    Optional, defaults to true. If set to false, AutoRefresh for this item will be disabled. By default, whenever a BaseEntity event is emitted for a save/delete, if the entity name for this config matches the BaseEntity's entity name, the config will be refreshed. If this is set to false, that will not happen. NOTE: This is not a network notification mechanism, it only works within the local tier, so for example within a browser application, that brower's engine sub-classes will be updated when changes are made to entities in that application environment, and the same is true for MJAPI/Server based environments. If you need network based notification, additional infrastructure will be needed to implement that.

    CacheLocal?: boolean

    When set to true, the engine will use the LocalCacheManager to cache results locally. On subsequent loads (unless forceRefresh is true), cached results will be returned immediately without hitting the server if they are still valid.

    This is useful for frequently-accessed, relatively-static data that doesn't need real-time freshness. The cache is automatically invalidated when entity data changes.

    false
    
    CacheLocalTTL?: number

    Optional TTL (time-to-live) in milliseconds for locally cached results when CacheLocal is true. After this time, cached results will be considered stale and fresh data will be fetched. If not specified, the LocalCacheManager's default TTL will be used (typically 5 minutes).

    DatasetItemFilters?: DatasetItemFilterType[]

    Optional, filters to apply to each item in a dataset, only applies when type is 'dataset' and is optional in those cases.

    DatasetName?: string

    The dataset name to load from the database, required if Type is 'dataset'

    DatasetResultHandling?: "single_property" | "individual_properties" = 'single_property'

    Optional, only used if Type is 'dataset', specifies how to handle the results of the dataset load. Defaults to 'single_property' if not specified. When set to 'single_property', the entire dataset is set to the property specified by PropertyName. When set to 'individual_properties', each item in the dataset is set to a property on the object with the name of the item's key plus the item's Code name. For example, if the item's key is 'Demo' and the item's Code name is 'FirstItem', the property set on the object would be 'Demo_FirstItem'.

    DebounceTime?: number

    Optional debounce time in milliseconds for this specific config. If not specified, uses the engine's default EntityEventDebounceTime (5000ms). This allows different entities to have different debounce delays.

    EntityName?: string

    The entity name to load from the database, required if Type is 'entity'

    Expiration?: number

    Optional, expiration time in milliseconds

    Filter?: string

    Optional, filters to apply to the data load, applies only when type is 'entity'. Use DatasetItemFilters for dataset filters.

    ID: any = null

    Primary Key

    OrderBy?: string

    Optional, order by clause to apply to the data load, only applies when type is 'entity'

    PropertyName: string

    The name of the property in the class instance

    ResultType?: "simple" | "entity_object"

    Controls whether loaded rows are returned as full BaseEntity subclass instances ('entity_object') or plain JavaScript objects ('simple').

    • 'entity_object': Full BaseEntity subclass instances with ORM capabilities (.Save(), .Delete(), validation, dirty-tracking). Required for engines whose data participates in immediate-mutation cache updates on entity save/delete events.
    • 'simple': Skips BaseEntity construction and class-factory lookup. Rows are plain objects with typed field values. Much faster for read-only configuration data that engines never mutate. NOTE: configs using 'simple' should be considered read-only — the immediate-mutation path operates on BaseEntity arrays and is not type-compatible with plain-object arrays.

    Resolution order when this property is left undefined:

    1. The engine subclass's EngineDefaultResultType getter (override per engine)
    2. The base getter, which returns 'entity_object'

    In other words, the effective default is 'entity_object' — leaving this undefined preserves the historical behavior. Do NOT initialize this field to a literal value here; it must remain undefined so the engine-level default can take effect.

    Type: "dataset" | "entity" = 'entity'

    The type of item to load, either 'entity' or 'dataset', defaults to 'entity'

    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

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