cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r1382267 - /cayenne/main/branches/STABLE-3.1/docs/docbook/cayenne-guide/src/docbkx/persistent-objects-objectcontext.xml
Date Sat, 08 Sep 2012 09:25:28 GMT
Author: aadamchik
Date: Sat Sep  8 09:25:28 2012
New Revision: 1382267


ObjectContext docs - local object

(cherry picked from commit ea74a0d3284bddc88286c80b5320f62c89a6eef6)


Modified: cayenne/main/branches/STABLE-3.1/docs/docbook/cayenne-guide/src/docbkx/persistent-objects-objectcontext.xml
--- cayenne/main/branches/STABLE-3.1/docs/docbook/cayenne-guide/src/docbkx/persistent-objects-objectcontext.xml
+++ cayenne/main/branches/STABLE-3.1/docs/docbook/cayenne-guide/src/docbkx/persistent-objects-objectcontext.xml
Sat Sep  8 09:25:28 2012
@@ -137,6 +137,14 @@ context.deleteObjects(artist2, artist3, 
 			update, delete operations are sent to the database only when "commitChanges" is called.
 			Similarly "rollbackChanges" will undo the effect of "newObject" and
+		<para><emphasis>localObject</emphasis> returns a copy of a given persistent
object that is
+			"local" to a given ObjectContext:</para>
+		<para>Since an application often works with more than one context, "localObject"
is a rather
+			common operation. E.g. to improve performance a user might utilize a single shared
+			context to select and cache data, and then occasionally transfer some selected objects
+			to another context to modify and commit
+			them:<programlisting>ObjectContext editingContext = runtime.getContext();
+Artist localArtist = editingContext.localObject(artist);</programlisting></para>
 		<para>Often an appliction needs to inspect mapping metadata. This information is
stored in
 			the EntityResolver object, accessible via the
 			ObjectContext:<programlisting>EntityResolver resolver = objectContext.getEntityResolver();</programlisting></para>

View raw message