REST.Backend.EMSServices.TEMSQueryAPI.Query
Delphi
procedure Query(const AClass: TBackendMetaClass;
const AQuery: array of string; const AJSONArray: TJSONArray); overload;
procedure Query(const AClass: TBackendMetaClass;
const AQuery: array of string; const AJSONArray: TJSONArray;
out AObjects: TArray<TBackendEntityValue>); overload;
C++
void __fastcall Query(const Rest::Backend::Metatypes::TBackendMetaClass AClass, const System::UnicodeString *AQuery, const System::NativeInt AQuery_High, System::Json::TJSONArray* const AJSONArray)/* overload */;
void __fastcall Query(const Rest::Backend::Metatypes::TBackendMetaClass AClass, const System::UnicodeString *AQuery, const System::NativeInt AQuery_High, System::Json::TJSONArray* const AJSONArray, /* out */ System::DynamicArray<Rest::Backend::Metatypes::TBackendEntityValue> &AObjects)/* overload */;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
procedure function |
protected | REST.Backend.EMSServices.pas REST.Backend.EMSServices.hpp |
REST.Backend.EMSServices | TEMSQueryAPI |
Description
Queries the EMS server for a list of objects of the specified type.
Query receives the following parameters:
AClassdetermines the class of the objects to query.AQueryis an array of strings where each string must contain a key-value pair separated by an equal sign, such as "my_parameter=my_value". Query adds those key-value pairs to the request as parameters.- Query fills
AJSONArraywith the results from the EMS server.
If you are querying users, groups or installations, you may optionally provide an array of instances of TBackendEntityValue (AObjects), so that Query fills the array with the objects that the EMS server returns.
- Note: Query only supports the
AObjectsfor users, groups and installations. You cannot useAObjectsto query modules or module resources.
Exceptions
| Exception | Message | Description |
|---|---|---|
|
JSON object expected |
You passed Query an array of instances of TBackendEntityValue ( The expected structure of the received JSON data is a JSON array of JSON objects. The actual structure of the received JSON data is a JSON array that contains one or more items that are not JSON objects. | |
|
MasterSecret required |
The type of authentication is TAuthentication.MasterSecret and the MasterSecret property of the connection information of the underlying EMS backend service is an empty string. | |
|
Session token required |
The type of authentication is TAuthentication.Session you did not log in. | |
|
Unsupported Backend query type: < |
Query does not support the backend data type of the specified class of the objects to query. |