OData server Architecture
An OData server consists of OData Producers and an HTTP server.
-
OData Producers
In SQL Anywhere, an OData Producer is a Java Servlet that uses the JDBC API to connect to a database server. An OData Producer processes OData requests and interfaces with the database.The following table illustrates how an OData Producer maps OData concepts to relational database concepts:
OData concept Database equivalent EntityRowEntity typeTable or view schemaEntity SetTable rows, where each row is an entity type instanceKeyPrimary keyAssociation and Navigation PropertiesForeign keyPropertyColumn or column value -
An HTTP server
An HTTP server handles OData requests from web clients.The database server uses the Jetty WebServer as its HTTP server for OData. This HTTP server acts as a Java Servlet container, which is required to host OData Producers.Alternatively, you can use a third-party HTTP server to handle OData requests, provided that your solution can host Java Servlets. For example, you can set up an IIS or Apache server to forward requests to a Tomcat or Jetty server.OData client requests are sent to an HTTP server through URIs and are processed by an OData Producer, which then interfaces with the database server to issue database requests and retrieve content for the OData responses.The OData schema for each client is based on the client's database connection permissions. Clients are not able to view or modify database objects that they do not have permission to view.Client access to the database can be granted by using either a pre-configured connection string or Basic HTTP authentication.
OData protocol limitations
OData Producers comply with OData protocol version 2 specifications with some limitations and exceptions.These limitations are not explicitly defined by OData protocol specifications.For more information about the OData protocol, see http://www.odata.org/documentation/odata-version-2-0.- Schema changes
Restart the OData Producers and modify the model when you make changes to the database schema so that the changes can take effect and become visible to OData clients.Update OData Producers to use different service roots in production environments because OData clients cache metadata.
- Search string filters
When using OData filters (such as substringof and indexof) on long search strings, searches are performed on the first 254 bytes only.
- substringof changes
The substringof(s1, s2) filter returns whether the s1 string is a substring of s2.
- $orderby queries
Sort by entity properties only. Ordering by direction is supported, but sorting by expressions is not.
- Proxy tables
When creating entities in entity sets that are proxy tables in a database, ensure that all key properties are explicitly specified.
- DefaultValue attributes
The DefaultValue attribute is not exposed because it is not appropriate for all possible default values that an underlying column in the database can have.A missing DefaultValue attribute does not imply that the default value for the property is null.
- Stored procedures
Stored procedures that return either multiple result sets or variable results (different data types based on invocation conditions) are not supported as service operations.Service operations must be explicitly exposed using an OData Producer Service model file.INOUT parameters are not supported.
Unsupported OData protocol features
The following OData protocol features are not supported by OData Producers:-
Dynamic properties
-
Complex types (except as return values from service operations)
-
Media types
-
If-Match (except If-Match: *) or If-None-Match HTTP headers with Retrieve Entity Set requests
- Schema changes