Member Junction
    Preparing search index...

    Represents a potential duplicate record with its probability score. Extends CompositeKey to support multi-field primary keys. Used in duplicate detection and record merging operations.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    KeyValuePairs: KeyValuePairOutputType[]
    ProbabilityScore: number
    VectorMetadata?: Record<string, string>

    Full vector metadata snapshot from the vector DB (Name, Description, EntityIcon, etc.)

    Accessors

    • get HasValue(): boolean

      Utility function to check if the composite key has any values set

      Returns boolean

    • get DefaultFieldDelimiter(): string

      Default delimiter for separating fields in a string that represents a key value pair within the composite key

      Returns string

    • get DefaultValueDelimiter(): string

      Default delimiter for separating values from field names in a string that represents a key value pair within the composite key

      Returns string

    Methods

    • Utility function to return a copy of the CompositeKey with the Value properties as string

      Returns CompositeKey

      a copy of the KeyValuePairs array but with the Value properties as string

    • Utility function to compare this composite key to another

      Parameters

      • compositeKey: CompositeKey

        the composite key to compare against

      Returns boolean

      true if the primary key values are the same, false if they are different

    • Utility function to compare the key primary key of this object to another sets to see if they are the same or not

      Parameters

      • kvPairs: KeyValuePair[]

        the primary key values to compare against

      Returns boolean

      true if the primary key values are the same, false if they are different

    • returns the value of the key value pair for the specified field name

      Parameters

      • fieldName: string

        the field name to get the value for

      Returns any

      the value of the key value pair for the specified field name

    • returns the value of the key value pair at the specified index

      Parameters

      • index: number

        the index of the key value pair to get the value for

      Returns any

      the value of the key value pair at the specified index

    • Utility to load the object from a string representation of the key value pairs in the format "Field1|Value1||Field2|Value2" etc. The delimiters between the fields default to '||' and the values default to '|', but can be anything desired.

      Parameters

      • concatenatedString: string
      • OptionalfieldDelimiter: string
      • OptionalvalueDelimiter: string

      Returns void

    • Loads the KeyValuePairs from a list of strings in the format "FieldName=Value"

      Parameters

      • list: string[]

        the list of strings to load from

      • Optionaldelimiter: string

        the delimiter to use between the field name and value. Defaults to '='

      Returns void

      ["ID=1", "Name=John"]
      
    • Loads from a simple object by extracting the key value pairs from the object

      Parameters

      • obj: any

      Returns void

    • Loads the key from a single key value pair

      Parameters

      • fieldName: string
      • value: any

      Returns void

    • Parses a provided url segment using the provided delimiter and loads the key value pairs from it. If the segment just contains a single value and no delimiter, it will assume the field name is the primary key field name of the entity and load that way.

      Parameters

      Returns void

    • Parses the provided routeSegment and assumes the field names are included in the segment

      Parameters

      • urlSegment: string

      Returns void

    • The exact inverse of CompositeKey.LoadFromURLSegment. A single-field key serializes to just its value — the shorthand LoadFromURLSegment maps back onto the entity's first primary key — while a multi-field key serializes to the full Field1|Value1||Field2|Value2 segment. A single value that itself contains the value delimiter also gets the full segment; the parsers (SimpleLoadFromURLSegment, LoadFromConcatenatedString) treat everything after the first delimiter as the value, so it round-trips rather than being truncated. A value containing the field delimiter (||) remains unrepresentable — a pre-existing limit of the format.

      This is the "compact" record-id form carried by search results, MJ: List Details, MJ: User Record Logs and Explorer record URLs: for the overwhelmingly common single-column primary key it is indistinguishable from the raw value, so IN (...) filters, dedup keys and persisted data all keep working, while composite keys still round-trip losslessly.

      Returns string

      "11055"                       // single-column key, any column name
      
      "OrderID|11055||LineNo|3"     // composite key
      
    • Utility to generate a string representation of the key value pairs in the format "Field1|Value1||Field2|Value2" etc. The field delimiter defaults to '||' and the value delimiter defaults to '|'

      Parameters

      • OptionalfieldDelimiter: string
      • OptionalvalueDelimiter: string

      Returns string

    • Parameters

      • Optionaldelimiter: string

        the delimiter to use between the field name and value. Defaults to '='

      Returns string[]

      the KeyValuePairs as a list of strings in the format "FieldName=Value"

      ["ID=1", "Name=John"]
      
    • The canonical serialization of this key for storage in a polymorphic RecordID column — the payload half of an EntityID/RecordID pair. Always the fully-prefixed Field1|Value1||Field2|Value2 form, so the string carries its own field names and round-trips without the reader needing to know the entity.

      This is the one encoding MJ writes going forward. It matches what SQLServerDataProvider already writes to RecordChange.RecordID and what Metadata.GetRecordChanges reads back; the bare RecordGeoCode form is the outlier and is read through FromLegacyRecordID until it migrates.

      Unlike ToConcatenatedString, this throws rather than emitting a string that cannot be parsed back: a value containing the value delimiter (|) would re-split into the wrong field/value boundary on the way in. Silently writing such a value is how a RecordID column ends up holding a key nothing can resolve.

      Returns string

      "ID|38CB433E-F36B-1410-8DA0-00021F8B792E"   // single-column key
      
      "OrderID|11055||LineNo|3"                    // composite key
      

      if the key holds no pairs, or any value contains the value delimiter

    • Parameters

      • OptionaluseIsNull: boolean

        if true, will return "FieldName IS NULL" for any key value pair that has a null or undefined value

      Returns string

      a string representation of the primary key values in the format "FieldName=Value"

      "ID=1 AND Name=John"
      
    • For URL segments, we use | and || as the standard delimiters for field and value respectively in order to avoid conflicts with the standard URL delimiters like = and &. This method converts the key value pairs to a URL segment

      Parameters

      • Optionalsegment: string

      Returns string

    • Utility function to return a string representation of the composite key in the format "FieldName=Value AND FieldName=Value"

      Parameters

      • OptionaluseIsNull: boolean

        if true, will return "FieldName IS NULL" for any key value pair that has a null or undefined value, if false, will return "FieldName=Value"

      • OptionalquoteStyle: "single" | "double"

      Returns string

      a string representation of the composite key in the format "FieldName=Value AND FieldName=Value"

      "ID=1 AND Name='John'"
      
    • Helper method to check if the underlying key value pairs are valid or not i.e. if any of the key value pairs are null or undefined

      Parameters

      • Optionalentity: EntityInfo

        If provided, this method will validate that the composite key is valid for the given entity as a primary key or alternate key.

      • OptionalprimaryKey: boolean

        If set to true, and entity is provided, this method will validate that the composite key is valid as the primary key for the given entity.

      Returns { ErrorMessage: string; IsValid: boolean }

      true if all key value pairs are valid, false if any are null or undefined

    • Parameters

      • Optionaldelimiter: string

        the delimiter to use between the values. Defaults to ', '

      Returns string

      the value of each key value pair in the format "Value1, Value2, Value3"

      "1, John"
      
    • Utility function to compare either single composite keys or arrays of composite keys. When comparing arrays, both order and content must match.

      Parameters

      Returns boolean

      true if the keys are equal, false otherwise. Returns false if types don't match (single vs array).

    • Many entities have a single primary key field called ID, this utility method allows you to create a CompositeKey from just that ID value.

      Parameters

      • id: any

      Returns CompositeKey

    • Static factory method to create a CompositeKey from a single key value pair.

      Parameters

      • key: string
      • value: any

      Returns CompositeKey

    • Static factory method to create a CompositeKey from an array of key value pairs. Mirrors the constructor but allows for a more explicit creation of a CompositeKey from an array of KeyValuePair objects.

      Parameters

      Returns CompositeKey

    • Reads the transitional bare-value RecordID form: a single primary key value with no field name (38CB433E-…), or a composite written as values only (val1||val2).

      Only RecordGeoCode writes this, via GeoCodeSyncService and the matching T-SQL in the base-view generator. It exists so the two hand-rolled sniffers (recent-access.service.ts, record-tags.component.ts) can be replaced by one named function whose name says it is temporary — and it is deliberately separate from FromRecordID so that "I am reading a legacy encoding" is a decision at the call site rather than a guess inside the parser. Delete it once RecordGeoCode is re-encoded.

      Field names come from entity.PrimaryKeys positionally, because the stored string does not carry them. That is exactly why the format is being retired: position is not a contract, so a primary key column reorder silently remaps the key.

      Parameters

      Returns CompositeKey

      if the number of values does not match entity.PrimaryKeys

    • Creates a CompositeKey from a simple object where the keys are the field names and the values are the values.

      Parameters

      • obj: any

      Returns CompositeKey

    • Reads a canonical RecordID string (see ToRecordID) back into a key, validated against the entity it is supposed to belong to.

      This is deliberately not a rename of LoadFromConcatenatedString, which cannot signal failure: given a string with no delimiter it leaves KeyValuePairs empty and returns normally, so every caller has to sniff the string itself to find out whether the parse happened. That is the defect behind the two hand-rolled sniffers in shared Angular code, and it is why a legacy bare composite (val1||val2) silently parses into phantom pairs with garbage field names instead of being rejected.

      The field-name check is what makes that safe: val1||val2 parses cleanly as a shape, but produces field names the entity does not have, so it is caught here rather than reaching the database as a key that matches nothing. A string with no delimiter at all is accepted only for a single-column primary key, where it is unambiguous, and takes its field name from FirstPrimaryKey — the same fallback LoadFromURLSegment already uses.

      Parameters

      • entity: EntityInfo

        the entity the record id belongs to; its PrimaryKeys define the expected shape

      • recordID: string

        the stored RecordID value

      Returns CompositeKey

      if recordID is empty, or its field names/arity do not match entity.PrimaryKeys

    • Static form of LoadFromURLSegment: builds a key from a record-id string that is either a bare value (a single-column primary key, mapped onto entity.FirstPrimaryKey whatever that column is called) or a full Field1|Value1||Field2|Value2 segment (a composite primary key). It reads both the compact form produced by ToCompactURLSegment and the always-prefixed form produced by ToURLSegment.

      Use this — not FromID — whenever the entity is a variable rather than a literal MJ core entity name. MJ supports primary keys with any column name(s) and type(s); hardcoding ID fails Load() with "Primary key ID not found in entity ..." for every entity whose key is called something else, and can never represent a multi-column key at all.

      When entity is null/undefined (metadata not resolvable) a delimited segment is parsed as-is since it already carries its field names, and a bare value falls back to an ID key so callers on an unknown entity keep the pre-existing behavior instead of throwing.

      Parameters

      Returns CompositeKey