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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

As a consequence of the transient nature of generated local keys, it is not possible to define navigation properties<br />

on these entities or use them in filter or order by conditions.<br />

OData Associations<br />

You can define associations between entities to express relationships between entities. With associations it is<br />

possible to reflect foreign key constraints on database tables, hierarchies and other relations between database<br />

objects. OSDL supports simple associations, where the information about the relationship is stored in one of the<br />

participating entities, and complex associations, where the relationship information is stored in a separate<br />

association table.<br />

Associations themselves are freestanding. On top of them you can specify which of the entities participating in the<br />

relationship can navigate over the association to the other entity by creating NavigationPropertys.<br />

For the examples used to illustrate OData associations, we use the tables customer and order:<br />

Table definition: sample.odata:customer.hdbtable<br />

table.schemaName = "ODATASAMPLES";<br />

table.tableType = COLUMNSTORE;<br />

table.columns = [<br />

{name = "ID"; sqlType = INTEGER; nullable = false;},<br />

{name = "RecruitID"; sqlType = VARCHAR; nullable = true;}<br />

];<br />

table.primaryKey.pkcolumns = ["ID"];<br />

Table definition: sample.odata:order.hdbtable<br />

table.schemaName = "ODATASAMPLES";<br />

table.tableType = COLUMNSTORE;<br />

table.columns = [<br />

{name = "ID"; sqlType = INTEGER; nullable = false;},<br />

{name = "CustomerID"; sqlType = INTEGER; nullable = false;}<br />

];<br />

table.primaryKey.pkcolumns = ["ID"];<br />

There is one relationship order.CustomerID to customer.ID and one relationship<br />

customer.RecruitID to customer.ID.<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. 195

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

Saved successfully!

Ooh no, something went wrong!