company logo

GET Query

Get queries will return all data for an instance. Instance attributes are shown using attribute names (using database terminology).

A GET query does not define field mappings, i.e. all attributes will be displayed by name. References and reference collection instances are provided as LOID-links.

Show

The mapping for a GET query for displaying person's properties would look like:

Class/type

Query/variable

Source

Comment

Company/GET

Show

Company(?id)

?id is a parameter passed with the HTTP request

The first four lines in the generated test script are generated for test purposes. The first line shows the URL for calling the query with GET method. The /Company(?id) line defines the HTTP GET URL executed internally.

Test: http://localhost:2000/query/GET/Company/Show?id=2

GET

user

pwd

/Company(?id)

Result

{ Company: { name: "My company",

employees: [ { url: LOID/7659 },

{ url: LOID/1113 },

... 102 links follow

{ url: LOID/7638 } ],

cars: [ { url: LOID/93 },

{ url: LOID/96 },

{ url: LOID/99 },

{ url: LOID/102 },

{ url: LOID/105 },

{ url: LOID/108 },

{ url: LOID/111 } ] } }

GetByLoid

In order to get data for referenced instanced, a global request could be submitted for retrieving data by local object identifier (LOID).


Class/type

Query/variable

Source

Comment

*/GET

GetByLoid

LOID(?id)

Global LOID query (without class name)

Attention: Providing a global LOID query allows WEB application to access any kind of data in the database, which is an advantage, but might also be a risk.

The URL executed internally by GET is shown below.

Test: http://localhost:2000/query/GET/*/GetByLoid?id=1113

GET

user

pwd

/LOID(?id)

Result

The query will return data for the first employee referenced in companies employees collection. Attributes are displayed by name, referenced instances as LOID-links.

{ VOID: { pid: "P127", name: "Figpk", first_name: [ "Fdvlqrjcmk","","" ],

  birth_date: 1965-03-10, sex: male, married: false, income: 3064.00,

  age: 57, children_inc: 32513.00, notes: null,

  location: [ ],

  children: [ { url: LOID/5781 },

    { url: LOID/5772 },

    { url: LOID/5763 },

    { url: LOID/5754 },

    { url: LOID/5658 },

    { url: LOID/5649 } ],

  parents: [ { url: LOID/1314 },

  { url: LOID/948 } ],

  employee: [ { url: LOID/1113 } ],

  company: [ { url: LOID/16 } ],

  used_cars: [ ] } }