skip to main content
Getting started with OData : Configuring an OData schema map
 

Try DataDirect Cloud Now

Configuring an OData schema map

Enable OData access by configuring an OData schema map and setting OData options. DataDirect Cloud generates OData schema maps in JSON format. See Understanding and configuring a schema map to understand the implications of configuring a schema map and Searching text-based columns for information on using text search.
While logged in to DataDirect Cloud, follow these steps to configure the schema map:
1. In the navigation pane, click Data Sources to open the Data Sources view.
*To create a new Data Source definition, click New Data Source, choose your data store type, and enter the appropriate information on the General tab. If you need help with the fields, see the documentation specific to your data store type, Data Source Connection Parameters.
*To enable OData for an existing Data Source, click the Data Source Name of the definition to edit.
The Edit Data Source screen opens.
2. Select the OData tab.
Click the thumbnail to see an example OData tab for a Salesforce Data Source. DDC - OData tab before schema map has been createdDDC - OData tab before schema map has been created
3. Click Configure Schema.
The Configure Schema wizard opens.
4. From the Select Schema pull-down list, select the schema that contains the tables to expose through OData.
The Configure Schema editor opens.
5. Select the tables and columns to expose to OData clients:
*Tables that have a primary key assigned in the underlying data store have a gold key icon next to the key column(s). You cannot change a key assigned by the data source. If a table does not have a primary key, select one or more columns as the primary key by clicking the key icon.
*Optionally, specify singular and plural names for the table by expanding the table node and select the Settings tab. In the schema map, DataDirect Cloud pluralizes the table name automatically. You use the plural entity name in OData requests. If the table name is plural already, the plural entity name will have an additional S, for example ACCOUNTSES. You can enter a plural name in this field to make entity addressing more intuitive.
6. Optionally, enable text search using the DataDirect proprietary ddsearch parameter for individual tables and specific text-based columns using the following steps. For the data store types that support indexing, make sure that your underlying data store contains the appropriate indices and that they are up to date.
a. Select Advanced Settings to enable search configuration.
b. Select a table and expand its details, select the Settings tab and select a search option: Substring enables searches for the string anywhere in the search-enabled fields; Begins restricts the search to the text at the beginning of a field; and Full Text, which is only available for data store types that support indexing and full text search. DDC - Configure Schema editor enable SearchDDC - Configure Schema editor enable Search
c. Select the table's Columns tab and click the search icon next to the text-based column(s) where you want to enable search. For data stores such as Oracle, that can expose multiple indices, when you click the search icon you can also select the index to submit ddsearch queries against. Note: If the data store index has not been properly configured and you select Full Text, queries using the ddsearch parameter will return errors.
The search icon for that column changes color as shown in the example.DDC - Configure column to enable searchDDC - Configure column to enable search
7. Optionally, click the editor's View Code button to see the JSON schema.
8. Click Save & Close to save your selections.
If you select a table that does not have a primary key and try to save, a message alerts you to select columns for the primary key:
The Schema Map field in the OData tab displays the schema map as a JSON string.
Next, set the remaining options on the OData tab.
Note: If the underlying data store schema changes or you need to modify the tables exposed by the schema map, edit the schema map and update the Data Source definition to refresh it.