TableRequestInfoV5

Overview

As well as TableRequestInfo, TableRequestInfoV5 class allows to specify additional custom parameters for getting data from certain schema table.

TableRequestInfoV5 extends TableRequestInfo class with new features Dynamic Where and Dynamic Select supported starting from DA v5.

Below you can find a sample that shows how to create and use TableRequestInfoV5.

var
  requestInfo: TableRequestInfoV5;
  requestInfoArr: array of TableRequestInfo;
  whereBuilder: TDAWhereBuilder;
begin
  workersTable.LogicalName := 'Workers';
  // create and setup request
  requestInfo := TableRequestInfoV5.Create;
  try
    with requestInfo do begin
      IncludeSchema := true;
      MaxRecords := -1;
      // specify Dynamic Select fields
      DynamicSelectFieldNames.Add('WorkerID');
      DynamicSelectFieldNames.Add('WorkerLastName');
      DynamicSelectFieldNames.Add('WorkerFirstName');
      DynamicSelectFieldNames.Add('WorkerPhone');
      
      // configure Dynamic Where
      whereBuilder := TDAWhereBuilder.Create;
      try
        with whereBuilder do begin
          Expression := NewBinaryExpression(
            workersTable.LogicalName,
            'WorkerID',
            dboEqual,
            3,
            datInteger);

          WhereClause := ExpressionToXmlNode(Expression);
        end;
      finally
        whereBuilder.Free;
      end;
    end;
    SetLength(requestInfoArr, 1);
    requestInfoArr[0] := requestInfo;
    
    // execute request
    ClientDataModule.RemoteDataAdapter.Fill([workersTable], requestInfoArr);
  finally
    requestInfo.Free;
  end;
end

Location


 

constructor Create  reintroduce overload virtual    (declared in TROComplexType)

Creates a new instance.

constructor Create

constructor Create (TCollection)  override    (declared in TableRequestInfo)

Creates a new instance with given parameter.

constructor Create(aCollection: TCollection)

Parameters:

  • aCollection: collection

Assign  override

Copies data from a given source.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

AssignTo  override    (declared in TROComplexType)

Copies the properties of an object to a destination object.

procedure AssignTo(iDest: TPersistent)

Parameters:

  • iDest: destination object.

Clone    (declared in TROComplexType)

Creates and returns a second copy of the struct.

The new instance will be a deep copy of the original struct, all nested members that are arrays, structs or binaries will be duplicated as part of the cloning process, so that the new instance and its members will be completely independent from the original class.

function Clone: TROComplexType

ContentAsJson    (declared in TROComplexType)

property ContentAsJson: UnicodeString read

ContentAsString    (declared in TROComplexType)

Returns the structure of the type in a string format.

property ContentAsString: string read

ContentAsXml    (declared in TROComplexType)

Returns the XML structure of the type in a string format.

property ContentAsXml: ROUTF8String read

DynamicSelectFieldNames

Property that holds an array of field names for Dynamic Select feature.

property DynamicSelectFieldNames: StringArray read write

FieldCount    (declared in TROComplexType)

property FieldCount: Integer read

FieldInfo    (declared in TROComplexType)

property FieldInfo[Index: Integer]: PTypeInfo read

FieldName    (declared in TROComplexType)

property FieldName[Index: Integer]: string read

FreeInternalProperties  protected override

procedure FreeInternalProperties

GetAttributeCount  virtual    (declared in TROComplexType)

Returns the number of custom attributes defined for the class.

class function GetAttributeCount: Integer

GetAttributeName  virtual    (declared in TROComplexType)

Returns the name of custom attribute defined for the class, with the specified index.

class function GetAttributeName(aIndex: Integer): string

Parameters:

  • aIndex: The index of attribute.

GetAttributeValue  virtual    (declared in TROComplexType)

Returns the value of custom attribute defined for the class, with the specified index.

class function GetAttributeValue(aIndex: Integer): string

Parameters:

  • aIndex: The index of attribute.

GetContentAsJson    (declared in TROComplexType)

function GetContentAsJson(aIncludeExtraInfo: Boolean): UnicodeString

Parameters:

  • aIncludeExtraInfo:

GetContentAsXml    (declared in TROComplexType)

function GetContentAsXml(aOffset: Integer): ROUTF8String

Parameters:

  • aOffset:

GetFieldNames    (declared in TROComplexType)

procedure GetFieldNames(aList: TStrings)

Parameters:

  • aList:

GetFieldValue    (declared in TROComplexType)

function GetFieldValue(const aFieldName: string): Variant

Parameters:

  • aFieldName:

IncludeSchema    (declared in TableRequestInfo)

Boolean property that specifies if table schema info s needed inside the result stream (true) or not (false, default). Usually, the client side already knows the schema, so passing the schema with the table data will cause some overhead, but if you need to update table schema info on the client side, you need to set that property to true.

For example, in DA for .NET you can create a new DataTable and try to fill it with data from a specified table. Since the structure for the new DataTable is not defined yet, you can establish to put the schema info with the table data, thus giving the data table a proper structure before it will be filled.

property IncludeSchema: Boolean read write

MaxRecords    (declared in TableRequestInfo)

This property allows to limit the count of rows of the request. Put it as -1 to receive all available records. 0 value will update the table schema without receiving any data.

Limiting the amount of transferred rows can reduce traffic between the DataAbstract server (middle tier) and the DataAbstract client (front-end tier). It will not affect traffic between the database and the DataAbstract server. For reducing traffic between the database and the DataAbstract server, you have to use other approaches, like Dynamic Where.

property MaxRecords: Integer read write

Parameters    (declared in TableRequestInfo)

Represents the array of the DataParameters for getting data from parametrized schema tables.

property Parameters: DataParameterArray read write

ReadComplex  override

Deserializes current class instance using provided serializer.

procedure ReadComplex(aSerializer: TObject)

Parameters:


SaveToJson  protected virtual    (declared in TROComplexType)

procedure SaveToJson(const aRoot: TROJSONValue; aIncludeExtraInfo: Boolean)

Parameters:

  • aRoot:
  • aIncludeExtraInfo:

SaveToXml  protected virtual    (declared in TROComplexType)

procedure SaveToXml(const aNode: TROConverterNode)

Parameters:

  • aNode:

SetFieldValue    (declared in TROComplexType)

procedure SetFieldValue(const aFieldName: string; const aValue: Variant)

Parameters:

  • aFieldName:
  • aValue:

SmartAssign    (declared in TROComplexType)

Copies specific data from a given source.

procedure SmartAssign(Source: TPersistent; TypeKinds: TTypeKinds)

Parameters:

  • Source: Instance whose properties will be copied
  • TypeKinds: Specifies which properties should be copied

Sorting

Property represents the information about sorting result data.

property Sorting: ColumnSorting read write

TryGetAttribute    (declared in TROComplexType)

class function TryGetAttribute(aName: string; out aValue: string): Boolean

Parameters:

  • aName:
  • aValue:

UserFilter    (declared in TableRequestInfo)

Uses for specifying custom conditions for returning rows. For example, "CustomerType < 100". Note that all records will be read from the database, but only those that fit the custom condition will be passed to the client.

property UserFilter: ROUTF8String read write

WhereClause

Property that holds Dynamic Where expression in XML format.

property WhereClause: IXmlNode read write

WriteComplex  override

Serializes current class instance using provided serializer.

procedure WriteComplex(aSerializer: TObject)

Parameters:

 

ContentAsJson    (declared in TROComplexType)

property ContentAsJson: UnicodeString read

ContentAsString    (declared in TROComplexType)

Returns the structure of the type in a string format.

property ContentAsString: string read

ContentAsXml    (declared in TROComplexType)

Returns the XML structure of the type in a string format.

property ContentAsXml: ROUTF8String read

DynamicSelectFieldNames

Property that holds an array of field names for Dynamic Select feature.

property DynamicSelectFieldNames: StringArray read write

FieldCount    (declared in TROComplexType)

property FieldCount: Integer read

FieldInfo    (declared in TROComplexType)

property FieldInfo[Index: Integer]: PTypeInfo read

FieldName    (declared in TROComplexType)

property FieldName[Index: Integer]: string read

IncludeSchema    (declared in TableRequestInfo)

Boolean property that specifies if table schema info s needed inside the result stream (true) or not (false, default). Usually, the client side already knows the schema, so passing the schema with the table data will cause some overhead, but if you need to update table schema info on the client side, you need to set that property to true.

For example, in DA for .NET you can create a new DataTable and try to fill it with data from a specified table. Since the structure for the new DataTable is not defined yet, you can establish to put the schema info with the table data, thus giving the data table a proper structure before it will be filled.

property IncludeSchema: Boolean read write

MaxRecords    (declared in TableRequestInfo)

This property allows to limit the count of rows of the request. Put it as -1 to receive all available records. 0 value will update the table schema without receiving any data.

Limiting the amount of transferred rows can reduce traffic between the DataAbstract server (middle tier) and the DataAbstract client (front-end tier). It will not affect traffic between the database and the DataAbstract server. For reducing traffic between the database and the DataAbstract server, you have to use other approaches, like Dynamic Where.

property MaxRecords: Integer read write

Parameters    (declared in TableRequestInfo)

Represents the array of the DataParameters for getting data from parametrized schema tables.

property Parameters: DataParameterArray read write

Sorting

Property represents the information about sorting result data.

property Sorting: ColumnSorting read write

UserFilter    (declared in TableRequestInfo)

Uses for specifying custom conditions for returning rows. For example, "CustomerType < 100". Note that all records will be read from the database, but only those that fit the custom condition will be passed to the client.

property UserFilter: ROUTF8String read write

WhereClause

Property that holds Dynamic Where expression in XML format.

property WhereClause: IXmlNode read write

 

GetAttributeCount  virtual    (declared in TROComplexType)

Returns the number of custom attributes defined for the class.

class function GetAttributeCount: Integer

GetAttributeName  virtual    (declared in TROComplexType)

Returns the name of custom attribute defined for the class, with the specified index.

class function GetAttributeName(aIndex: Integer): string

Parameters:

  • aIndex: The index of attribute.

GetAttributeValue  virtual    (declared in TROComplexType)

Returns the value of custom attribute defined for the class, with the specified index.

class function GetAttributeValue(aIndex: Integer): string

Parameters:

  • aIndex: The index of attribute.

TryGetAttribute    (declared in TROComplexType)

class function TryGetAttribute(aName: string; out aValue: string): Boolean

Parameters:

  • aName:
  • aValue:

 

constructor Create  reintroduce overload virtual    (declared in TROComplexType)

Creates a new instance.

constructor Create

constructor Create (TCollection)  override    (declared in TableRequestInfo)

Creates a new instance with given parameter.

constructor Create(aCollection: TCollection)

Parameters:

  • aCollection: collection

Assign  override

Copies data from a given source.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

AssignTo  override    (declared in TROComplexType)

Copies the properties of an object to a destination object.

procedure AssignTo(iDest: TPersistent)

Parameters:

  • iDest: destination object.

Clone    (declared in TROComplexType)

Creates and returns a second copy of the struct.

The new instance will be a deep copy of the original struct, all nested members that are arrays, structs or binaries will be duplicated as part of the cloning process, so that the new instance and its members will be completely independent from the original class.

function Clone: TROComplexType

FreeInternalProperties  protected override

procedure FreeInternalProperties

GetContentAsJson    (declared in TROComplexType)

function GetContentAsJson(aIncludeExtraInfo: Boolean): UnicodeString

Parameters:

  • aIncludeExtraInfo:

GetContentAsXml    (declared in TROComplexType)

function GetContentAsXml(aOffset: Integer): ROUTF8String

Parameters:

  • aOffset:

GetFieldNames    (declared in TROComplexType)

procedure GetFieldNames(aList: TStrings)

Parameters:

  • aList:

GetFieldValue    (declared in TROComplexType)

function GetFieldValue(const aFieldName: string): Variant

Parameters:

  • aFieldName:

ReadComplex  override

Deserializes current class instance using provided serializer.

procedure ReadComplex(aSerializer: TObject)

Parameters:


SaveToJson  protected virtual    (declared in TROComplexType)

procedure SaveToJson(const aRoot: TROJSONValue; aIncludeExtraInfo: Boolean)

Parameters:

  • aRoot:
  • aIncludeExtraInfo:

SaveToXml  protected virtual    (declared in TROComplexType)

procedure SaveToXml(const aNode: TROConverterNode)

Parameters:

  • aNode:

SetFieldValue    (declared in TROComplexType)

procedure SetFieldValue(const aFieldName: string; const aValue: Variant)

Parameters:

  • aFieldName:
  • aValue:

SmartAssign    (declared in TROComplexType)

Copies specific data from a given source.

procedure SmartAssign(Source: TPersistent; TypeKinds: TTypeKinds)

Parameters:

  • Source: Instance whose properties will be copied
  • TypeKinds: Specifies which properties should be copied

WriteComplex  override

Serializes current class instance using provided serializer.

procedure WriteComplex(aSerializer: TObject)

Parameters:

 

  • TableRequestInfoV5 Class: