skip to main content
Querying with OData Version 2 : Understanding and configuring a schema map for OData Version 2 : Schema map examples
  

Try Now

Schema map examples

In the following example from an Oracle data source, both the Employees and the Departments tables are enabled for full-text search. In the Employees table, the id column is searchable. In the Departments table, the id column is searchable and the address column is not included in the model; OData requests will not return data from the address column.

{
"odata_mapping_v2": {
"schemas": [{
"name": "Emp",
"tables":
{
"Employees": {
"ODataAlias": "Employee",
"ODataPluralAlias": "Employees",
"searchMode": "full-text",
"columns": {
"id": {
"primaryKeyComponent": 1
},
"EmployeeName": {
"searchable": true
"indexType": "CTXCAT"
}
}
},
"Departments": {
"ODataAlias": "Department",
"searchMode": "full-text",
"columns": {
"id": {
"primaryKeyComponent": 1
},
"DepartmentName": {
"searchable": true
}
},
"excludedColumns": ["address"]
}
}
}]
}
}
The following example uses tables in a MySQL datasource. As in the previous example, both the Employees and the Departments tables are enabled for full-text search. In the Employees table, the id column is searchable. In the Departments table, the id column is searchable and the address column is not included in the model; OData requests will not return data from the address column.

{
"odata_mapping_v2": {
"schemas": [{
"name": "-",
"tables":
{
"Employees": {
"ODataAlias": "Employee",
"ODataPluralAlias": "Employees",
"searchMode": "full-text",
"columns": {
"id": {
"primaryKeyComponent": 1
},
"EmployeeName": {
"searchable": true
}
}
},
"Departments": {
"ODataAlias": "Department",
"searchMode": "full-text",
"columns": {
"id": {
"primaryKeyComponent": 1
},
"DepartmentName": {
"searchable": true
}
},
"excludedColumns": ["address"]
}
}
}]
}
}