skip to main content
Querying with OData Version 2 : Getting started with OData Version 2 : Configuring data sources for OData Version 2 connectivity
  

Try Now

Configuring data sources for OData Version 2 connectivity

Hybrid Data Pipeline supports OData Version 2 and Version 4 connectivity for all supported data stores. You can configure a data source on any data store for OData connectivity either during the process of creating the data source or after the data source has been created.
The following steps describe how to configure a data source for OData Version 2 connectivity.
1. From the Web UI, navigate to the Data Sources view by clicking the data sources icon .
*Option 1. If creating a new data source, click New Data Source, choose the data store, enter the required information on the General tab, and click TEST to confirm connectivity to the backend data store. (See Creating data sources with the Web UI for details.)
*Option 2. If enabling OData on an existing data source, select the data source you wish to modify.
2. Select the OData tab.
Click the thumbnail to view the screen
OData tabOData tab
3. For OData Version, select Version 2.
4. Open the Configure Schema editor by clicking Configure to the right of the Schema Map field.
Click the thumbnail to view the screen
Configure Schema editor - tables and columns tab selectedConfigure Schema editor - tables and columns tab selected
5. Select a schema from the Select Schema dropdown.
Note: By default, Hybrid Data Pipeline exposes all schemas on any backend data stores that support multiple schemas. The Metadata Exposed Schemas option on the Advanced tab for any such data store can be used to limit exposed schemas to a single schema. If a schema is selected for the Metadata Exposed Schemas option, it will be the only schema available on the Configure Schema editor's Select Schema dropdown.
6. Select the Tables and Columns tab. Then select and define the tables and columns you want to expose to OData client applications.
*To add all tables, click Add All Tables on the Tables panel.
*To add individual tables, select a table on the Tables panel and click Add To Map in the Settings panel to the right.
*To remove a table that was previously added, select the table and click Remove From Map in the Settings panel.
*To specify singular and plural alias names for a table, select the table, enter the table alias for the entity type name in the Singular Name field, enter the table alias for the entity collection name in the Plural Name field, and click Add To Map.
The singular alias name specified is used as the entity type name, while the plural alias name will be used as the entity collection name. If alias names are not specified, the table name is used as the entity type name and pluralized for the entity collection name. For example, the entity type name for the table ACCOUNTS would be ACCOUNTS, while the entity collection name would be ACCOUNTSES.
*To specify a column as a primary key, select the column from the Columns panel and set the Is Primary Key switch from OFF to ON.
The Configure Schema editor indicates that a primary key exists for a table with a star icon. A primary key assigned in the backend data store cannot be changed. If a primary key has not been discovered for a table you wish to map, one or more columns must be specified as a primary key.
*To remove a column from the OData schema map, select the column from the Columns panel and click Remove From Map in the Settings panel.
When a table is added, all columns in the table are exposed in the OData schema map by default. You can modify the columns exposed by removing (or excluding) them from the schema map.
7. Take the following steps to enable text search for individual tables and text-based columns using the ddsearch custom query parameter.
a. Select a table from the Tables panel.
b. Specify a search option from the Search Options dropdown. Then click Add To Map.
*Full Text is only available for data store types that support indexing and full text search.
*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.
c. If you selected Full Text in Step b, you should select an index type for all text-based columns. Select the column from the Columns panel, and specify an index type from the Index Type dropdown in the Settings panel. Then click Add To Map.
The index type is the type of index supported by the backend data store. TEXT is the only valid value for the DB2 and SQL Server data stores. CONTEXT and CTXCAT are the valid values for the Oracle data store. If Full Text has been selected but the data store index has not been properly configured, queries using ddsearch will return errors.
d. If you selected Substring or Begins in Step b, you should select which text-based columns can be searched. Select the column from the Columns panel, and set the Is Searchable switch to ON. Then click Add To Map.
8. Click the Review Schema Map tab to review the OData schema map in JSON format.
Click the thumbnail to view the screen
Configure Schema editor - review schema tab selectedConfigure Schema editor - review schema tab selected
9. Click Save Map to save your configuration of the OData schema map.
10. Set OData options to the desired values.
*Data Source Caching controls caching of results. A value of 0 results in a stateless session, requiring Hybrid Data Pipeline to access the data store for each request. A value of 1, the default, allows Hybrid Data Pipeline to cache results, improving performance for repeated requests for the same entity. Hybrid Data Pipeline clears the cache after ten minutes of inactivity or at the end of a session.
*Page Size controls the number of results returned in one response. By default, the value in this field is 0 which causes Hybrid Data Pipeline to return up to 2,000 top-level entities per response. If the response contains more than 2,000 entities, the first 2,000 entities are returned and the end of the response contains a link that the OData client can use to fetch the next set. You can set the page size by using values from 1 to 10,000. Client requests can also specify the size of results with query parameters.
*Refresh Result determines whether Hybrid Data Pipeline returns results from the cache (for entities in the cache) or queries the data source again. A value of 1, the default, allows Hybrid Data Pipeline to satisfy requests from cached results. A value of 0 forces queries to the backend data store. If caching is not enabled, this parameter has no effect.
*Inline Count Mode controls how Hybrid Data Pipeline handles requests that include the $inlinecount parameter with a value of allpages. The response includes the total number of entities that satisfy the query. A value of 0 causes Hybrid Data Pipeline to skip counting. A value of 1 causes Hybrid Data Pipeline to run a separate query to get the count before the query that returns the entities. This can result in the first page of results being returned faster for large result sets for some data store types. A value of 2, the default, causes Hybrid Data Pipeline to fetch all results and calculate the total number before returning the first page of results to the client.
*Top Mode allows Hybrid Data Pipeline to better handle requests that include the $top parameter. A value of 0, the default, indicates that clients using $top to limit result set size will rarely attempt to get additional entities using the $skip parameter. A value of 1 indicates that clients generally use $top and $skip together to paginate results.
*OData Read Only controls read/write access. For a new data source definition, this option is not selected by default. For a data source definition where OData was enabled before this option was available, it will be checked by default. Remove the check mark to enable write access.
11. Click Update to save your work.
What to do next:
Test your OData-enabled data source as described in Testing data source configurations (OData Version 2).
After you create an OData-enabled data source, you can view the status of the schema map generation on the Data Sources screen. The icon besides the OData-enabled data source indicates the status of the schema map generation. The following table provides details of the icons.
Icon
Description
Schema Synch in progress
The synchronization of the schema map is in progress. The number denotes the percentage of synchronization completed.
Sync completed successfully
The schema map was synchronized successfully.
Sync completed successfully, with warning messages
The schema map was synchronized successfully, but there are some table/column warnings. Hybrid Data Pipeline allows users to know the details of the tables/columns and/or functions that were dropped while generating the OData Model for a given schema map of a Data Source. The number of warnings shown is limited to 100. If there are more than 100 errors/warnings, you can use the Schema API to retrieve table and column warnings.
Errors when synching a schema map
Errors occurred while synchronizing the schema map. You must address the errors and synchronize the schema map again. Hybrid Data Pipeline allows users to know the details of the tables and/or columns that were dropped while generating the OData Model for a given schema map of a Data Source. The number of errors/warnings shown is limited to 100. If there are more than 100 errors/warnings, you can use the Schema API to retrieve table and column warnings.
Schema map resynch needed
You must synchronize the schema map again.