Member Junction
    Preparing search index...

    Composite keys are used to represent database keys and can include one or more key value pairs.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    KeyValuePairs: KeyValuePair[]

    Accessors

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

    • 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
      • fieldDelimiter: string = '||'
      • valueDelimiter: 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"]
      
    • 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

      • fieldDelimiter: string = '||'
      • valueDelimiter: string = '|'

      Returns string

    • 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

      • useIsNull: boolean = true

        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"

      • quoteStyle: "single" | "double" = 'single'

      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.

      • primaryKey: boolean = true

        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