Skip to content

Nodedef

In order for data to be visible and, depending on the configurator's wishes, modifiable on the UI, a connection to a database is necessary. Such connection is established in the so called nodedef, which stands for node definition. The nodedef is simply a JSON-file where the configurator specifies both the tables and the attributes that he or she intends to utilize. The example below makes the point clearer with the help of file EmployeeAll.json:

{
  "table": "Employee",
  "join": [
    {
      "table": "Wage",
      "alias": "wage",
      "on": "wage.employee_id = :id"
    }
  ],
  "attributes": [
    "id",
    "name",
    "surname",
    "address",
    "department_id",
    {
      "name": "gross_salary",
      "column": "gross_salary",
      "from": "wage"
    }
  ]
}

Please notice that:

  • At the beginning of the file the main table is specified (Employee). To this table a secundary table is joined (Wage).
  • In the value of the on-key the main table is replaced by :, while the secundary table is written out in full.
  • In the attribute-list the attributes belonging to the main table are directly listed, while the attributes belonging to the secundary table require three parameters each.
  • In the attribute-list the secundary table is referenced through its alias.

The JSON-file above constitutes a node. This node is to be referenced within another important building block for the configuration: the mapping-file.