Class CustomElementsUtil

java.lang.Object
com.denodo.common.custom.elements.CustomElementsUtil

public final class CustomElementsUtil extends Object
This class allows the user to create instances of Custom types and values like CustomArrayType, CustomArrayValue, CustomRecordType and CustomRecordValue.
Since:
4.6
  • Method Details

    • createCustomArrayType

      public static CustomArrayType createCustomArrayType(String arrayName, CustomRecordType arrayType)
      Factory method to instantiate a CustomArrayType.
      Parameters:
      arrayName - Name of the type.
      arrayType - Type that this array will represent a list of.
      Returns:
      The created type.
    • createCustomArrayType

      public static CustomArrayType createCustomArrayType(CustomRecordType arrayType)
      Factory method to instantiate a CustomArrayType without name.
      Parameters:
      arrayType - Type that this array will represent a list of.
      Returns:
      The created type.
    • createCustomArrayValue

      public static CustomArrayValue createCustomArrayValue(List<CustomRecordValue> values)
      Factory method to instantiate a CustomArrayValue.
      Parameters:
      values - List of records stored in the array.
      Returns:
      The created value.
    • createCustomRecordType

      public static CustomRecordType createCustomRecordType(String recordName, LinkedHashMap<String,Object> properties)
      Factory method to instantiate a CustomRecordValue.
      Parameters:
      recordName - Name of the type.
      properties - Fields for the new record. The map key stores the field name and the Object is the field type.
      Returns:
      The created type.
    • createCustomRecordType

      public static CustomRecordType createCustomRecordType(LinkedHashMap<String,Object> properties)
      Factory method to instantiate a CustomRecordValue without name.
      Parameters:
      properties - Fields for the new record. The map key stores the field name and the Object is the field type.
      Returns:
      The created type.
    • createCustomRecordValue

      public static CustomRecordValue createCustomRecordValue(LinkedHashMap<String,Object> properties)
      Factory method to instantiate a CustomRecordValue.
      Parameters:
      properties - The field values for the new record. The map key stores the field name and the object is the field value.
      Returns:
      The created value
    • getQueryContext

      public static QueryContext getQueryContext()
      Returns context information about the query executing the function. Such object contains: user, roles and database.

      Note: this method only returns a QueryContext when is invoked from a custom function. It returns NULL when is invoked from a custom stored procedure, a custom wrapper or a custom input filter.

      Returns:
      QueryContext containing information about the query executing the function
      Since:
      6.0 Update 20160429