Author: buildbot
Date: Tue Nov 17 15:42:07 2015
New Revision: 972719
Log:
Staging update by buildbot for olingo
Modified:
websites/staging/olingo/trunk/content/ (props changed)
websites/staging/olingo/trunk/content/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html
Propchange: websites/staging/olingo/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Nov 17 15:42:07 2015
@@ -1 +1 @@
-1714811
+1714813
Modified:
websites/staging/olingo/trunk/content/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html
==============================================================================
---
websites/staging/olingo/trunk/content/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html
(original)
+++
websites/staging/olingo/trunk/content/doc/odata4/tutorials/deep_insert/tutorial_deep_insert.html
Tue Nov 17 15:42:07 2015
@@ -151,7 +151,11 @@ Such a request is issued againest the UR
<p>To express the relation between two entities, Olingo uses the class <a
href="http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Link.html">Link</a>.
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 <a
href="http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Linked.html#getNavigationLink(java.lang.String)"><code>getNavigationLink(String
name)</code></a> 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 <a
href="http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Link.html#getInlineEntity()"><code>getInlineEntity()</code></a>
or <a href="http://olingo.apache.org/javadoc/odata4/o
rg/apache/olingo/commons/api/data/Link.html#getInlineEntitySet()"><code>getInlineEntitySet()</code></a>
The same can be done for bindings via the method <a
href="http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Linked.html#getNavigationBinding(java.lang.String)"><code>getNavigationBinding(String
name)</code></a>. The values of the Binding can be gotten by the methods <a
href="http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Link.html#getBindingLink()"><code>getBindingLink()</code></a>
and <a
href="http://olingo.apache.org/javadoc/odata4/org/apache/olingo/commons/api/data/Link.html#getBindingLinks()"><code>getBindingLinks()</code></a>.
</p>
<p>The point is that the Entity deserializer uses the same concept to
represent the payload as Java objects.
-In the previous tutorials the entity object returned by the deserializer is
passed to the data store. Please open the class
<code>myservice.mynamespace.data.Storage</code> and jump the method
<code>createEntity</code>.</p>
+Please have a look at the figure below. The deserializer returns an entity
with two aggregated Link Objects which belons to the same navigation property
"Product". The upper Link object stores the related entites, which have to be
created. The lower Link contains the entity-ids to the already existing
entities.
+<img alt="Deserializer Result" src="before.png" /></p>
+<p>When our implementation has processed the whole request, all entites are
created and linked as <strong>navigationLinks</strong>.</p>
+<p><img alt="After Deep insert" src="after.png" /></p>
+<p>In the previous tutorials the entity object returned by the deserializer is
passed to the data store. Please open the class
<code>myservice.mynamespace.data.Storage</code> and jump the method
<code>createEntity</code>.</p>
<p>The implementation should look like the following:</p>
<div class="codehilite"><pre><span class="kd">private</span> <span
class="n">Entity</span> <span class="nf">createEntity</span><span
class="o">(</span><span class="n">EdmEntitySet</span> <span
class="n">edmEntitySet</span><span class="o">,</span> <span
class="n">EdmEntityType</span> <span class="n">edmEntityType</span><span
class="o">,</span> <span class="n">Entity</span> <span
class="n">entity</span><span class="o">,</span>
<span class="n">List</span><span class="o"><</span><span
class="n">Entity</span><span class="o">></span> <span
class="n">entityList</span><span class="o">,</span> <span
class="kd">final</span> <span class="n">String</span> <span
class="n">rawServiceUri</span><span class="o">)</span> <span
class="kd">throws</span> <span class="n">ODataApplicationException</span> <span
class="o">{</span>