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.

An empty service metadata document consists of one Schema containing an empty EntityContainer. The<br />

name of the EntityContainer is the name of the .xsodata file, in this example "empty".<br />

OData Namespace Definition<br />

By default, as shown in the metadata file of an empty OData service, the namespace of the generated Schema is<br />

created by concatenating the package name of the .xsodata file with the file name, and separating the<br />

concatenated names with a dot. You can specify your own namespace by using the namespace keyword:<br />

Service definition sample.odata:namespace.xsodata<br />

service namespace "my.namespace" {}<br />

The resulting service metadata document has the specified schema namespace:<br />

http://localhost:8002/sample/odata/namespace.xsodata/$metadata<br />

OData Object Exposure<br />

There are two ways of exposing <strong>SAP</strong> <strong>HANA</strong> objects. You can either specify the repository design-time name or the<br />

database-object runtime name (with database schema). Although both variants are supported, the preferred<br />

method is the exposure via the repository design-time name. It has the advantage that the OData service is<br />

automatically updated, if the underlying repository object changes. The support for database objects is mainly<br />

intended for existing or replicated objects that do not have a related repository design-time object.<br />

In the examples provided to illustrate object exposure, the following definition of a table applies:<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. 189

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

Saved successfully!

Ooh no, something went wrong!