Author: chrish
Date: Wed Nov 18 01:54:56 2015
New Revision: 1714917
URL: http://svn.apache.org/viewvc?rev=1714917&view=rev
Log:
CMS commit to olingo by chrish
Modified:
olingo/site/trunk/content/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.mdtext
Modified:
olingo/site/trunk/content/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.mdtext
URL:
http://svn.apache.org/viewvc/olingo/site/trunk/content/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.mdtext?rev=1714917&r1=1714916&r2=1714917&view=diff
==============================================================================
---
olingo/site/trunk/content/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.mdtext
(original)
+++
olingo/site/trunk/content/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.mdtext
Wed Nov 18 01:54:56 2015
@@ -47,7 +47,7 @@ OData uses to create a related entity th
**Example**
-For example you may want to create a new category and also create new
products, which are related to the new created category. In addition you would
like to bind an existing entity to the new created category.
+For example you may want to create a new category and also create new
products, which are related to the new created category. In addition you would
like to bind an existing product to the new created category.
Such a request is issued againest the URL of the entity set.
In this example, a new Category "Food" and two products ("Bread", "Milk") are
created. In addition the Product with the key 5 is bind to the just created
entity.
@@ -83,7 +83,7 @@ Afterwards do a Deploy and run: it shoul
# 2. Implementation
-Before we start with the implementation, please have a look at the class
`myservice.mynamespace.data.Storage`. In difference to the [navigation
tutorial](http://olingo.apache.org/doc/odata4/tutorials/navigation/tutorial_navigation.html)
the relations between two entities can not be hard coded because we would like
to create and change relations between entities dynamically. In the constructor
of the data storage the creation of the sample data is called. After that the
method `linkProductsAndCategories`is called. This methods sets a few links
between the just created entities. **The linked entites are stored as
navigation link**
+Before we start with the implementation, please have a look at the class
`myservice.mynamespace.data.Storage`. In difference to the [navigation
tutorial](http://olingo.apache.org/doc/odata4/tutorials/navigation/tutorial_navigation.html)
the relations between two entities can not be hard coded because we would like
to create and change relations between entities dynamically. In the constructor
of the data storage the creation of the sample data is called. After that the
method `linkProductsAndCategories`is called. This methods sets a few links
between the just created entities. **The linked entites are stored as
navigation links**
To express the relation between two entities, Olingo uses the class
[Link](http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Link.html).
This class is used for related entites (directly connected via Java
references) and bindings (which are actually strings) to other entities. To get
the related entites for a particual navigation property, you can ask an entity
with the method [`getNavigationLink(String
name)`](http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Linked.html#getNavigationLink(java.lang.String))
for an navigation property link. The link will contain either an entity or a
collection of entities dependenting on the type of the navigation property. To
get the actual entities use the methods
[`getInlineEntity()`](http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Link.html#getInlineEntity())
or
[`getInlineEntitySet()`](http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Link.htm
l#getInlineEntitySet())
The same can be done for bindings via the method [`getNavigationBinding(String
name)`](http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Linked.html#getNavigationBinding(java.lang.String)).
The values of the Binding can be gotten by the methods
[`getBindingLink()`](http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Link.html#getBindingLink())
and
[`getBindingLinks()`](http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Link.html#getBindingLinks()).