You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by bu...@apache.org on 2016/03/01 22:55:28 UTC

svn commit: r981563 - in /websites/staging/cayenne/trunk/content: ./ docs/4.0/tutorial/ch08.html

Author: buildbot
Date: Tue Mar  1 21:55:28 2016
New Revision: 981563

Log:
Staging update by buildbot for cayenne

Modified:
    websites/staging/cayenne/trunk/content/   (props changed)
    websites/staging/cayenne/trunk/content/docs/4.0/tutorial/ch08.html

Propchange: websites/staging/cayenne/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Mar  1 21:55:28 2016
@@ -1 +1 @@
-1733104
+1733161

Modified: websites/staging/cayenne/trunk/content/docs/4.0/tutorial/ch08.html
==============================================================================
--- websites/staging/cayenne/trunk/content/docs/4.0/tutorial/ch08.html (original)
+++ websites/staging/cayenne/trunk/content/docs/4.0/tutorial/ch08.html Tue Mar  1 21:55:28 2016
@@ -19,9 +19,7 @@
                     exist without being displayed in a gallery.</p></li><li class="listitem"><p>For Painting et both relationships rules to "Nullify".</p></li></ul></div><p>Now save the mapping, and refresh the project in Eclispe.</p></div><div class="section" title="Deleting Objects"><div class="titlepage"><div><div><h2 class="title"><a name="deleting-objects"></a>Deleting Objects</h2></div></div></div><p>While deleting objects is possible via SQL, qualifying a delete on one or more IDs, a
             more common way in Cayenne (or ORM in general) is to get a hold of the object first, and
             then delete it via the context. Let's use utility class Cayenne to find an
-            artist:</p><pre class="programlisting">Expression qualifier = ExpressionFactory.matchExp(Artist.NAME_PROPERTY, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"Pablo Picasso"</span>);
-SelectQuery select = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SelectQuery(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, qualifier);
-Artist picasso = (Artist) Cayenne.objectForQuery(context, select);</pre><p>Now let's delete the artist:</p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">if</span> (picasso != null) {
+            artist:</p><pre class="programlisting">Artist picasso = ObjectSelect.query(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).where(Artist.NAME.eq(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"Pablo Picasso"</span>)).selectOne(context);</pre><p>Now let's delete the artist:</p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">if</span> (picasso != null) {
     context.deleteObject(picasso);
     context.commitChanges();
 }</pre><p>Since we set up "Cascade" delete rule for the Artist.paintings relationships, Cayenne