28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The OData specification requires an EntityType to denote a set of properties forming a unique key. In <strong>SAP</strong><br />

<strong>HANA</strong>, only tables can have a unique key, the primary key. All other (mostly view) objects require you to<br />

specify a key for the entity. The OData service definition language (OSDL) enables you to do this by denoting a<br />

set of existing columns or by generating a local key. Bear in mind that local keys are transient; they exist only<br />

for the duration of the current session and cannot be dereferenced.<br />

Note: OSDL is the language used to define a service definition; the language includes a list of keywords<br />

that you use in the OData service-definition file to enable the required features.<br />

● Parameter Entity Sets<br />

You can use a special parameter entity set to enter input parameters for <strong>SAP</strong> <strong>HANA</strong> calculation views and<br />

analytic views. During activation of the entity set, the specified parameters are retrieved from the metadata of<br />

the calculation (or analytical) view and exposed as a new EntitySet with the name suffix "Parameters", for<br />

example "CalcViewParameters".<br />

● Projection<br />

If the object you want to expose with an OData service has more columns than you actually want to expose,<br />

you can use SQL views to restrict the number of selected columns in the SELECT. However, for those cases<br />

where SQL views are not appropriate, you can use the with or without keywords in the OData service<br />

definition to include or exclude a list of columns.<br />

8.1.3 OData URI Parameters, Query Options, and Features<br />

Since OData fully embraces Web technologies, and more specifically URI concepts, all the actions that manage<br />

the interaction with the service at runtime are controlled by HTTP methods, the URI structure, or URI query<br />

parameters.<br />

The examples listed here illustrate how to use the OData service-definition file to specify what data to extract and<br />

what to do with it. You can find examples of the following features:<br />

● HTTP Methods<br />

For example, HTTPGET<br />

● Resource types<br />

For example: Service documents, entity sets, $metadata, and so on<br />

● Query options<br />

For example, $format, $filter, $select, and so on<br />

HTTP Methods<br />

Since the current OData Infrastructure only supports read services (no Create/Update/Delete), the only<br />

supported HTTP Method is GET and POST for $batch (containing only GET requests). The result is that only read<br />

requests are possible.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Defining Web-based Data Access<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved. 167

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!