Author: aadamchik Date: Sat Feb 6 12:02:06 2016 New Revision: 1728828 URL: http://svn.apache.org/viewvc?rev=1728828&view=rev Log: refreshing 4.0 docs
Modified: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/cayenne-guide-part2.html cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/configuration-properties.html cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/customizing-cayenne-runtime.html cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/index.html cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/lifecycle-events.html cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/performance-tuning.html cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/queries.html cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/service-collections.html cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/setup.html Modified: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/cayenne-guide-part2.html URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/cayenne-guide-part2.html?rev=1728828&r1=1728827&r2=1728828&view=diff ============================================================================== --- cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/cayenne-guide-part2.html (original) +++ cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/cayenne-guide-part2.html Sat Feb 6 12:02:06 2016 @@ -9,4 +9,4 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); - </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.M3-SNAPSHOT)</th><th align="center">Part II. Cayenne Framework</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="cayennemodeler-application.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="including-cayenne-in-project.html">Next</a></td></tr></table><hr></div><div class="part" title="Part II. Cayenne Framework"><div class="titlepage"><div><div><h1 class="title"><a name="cayenne-guide-part2"></a>Part II. Cayenne Framework</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="including-cayenne-in-project.html">4. Including Cayenne in a Project</a></sp an></dt><dd><dl><dt><span class="section"><a href="including-cayenne-in-project.html#jar-files-and-depdendencies">Jar Files and Dependencies</a></span></dt><dt><span class="section"><a href="including-cayenne-in-project.html#maven-projects">Maven Projects</a></span></dt><dt><span class="section"><a href="including-cayenne-in-project.html#ant-projects">Ant Projects</a></span></dt></dl></dd><dt><span class="chapter"><a href="starting-cayenne.html">5. Starting Cayenne</a></span></dt><dd><dl><dt><span class="section"><a href="starting-cayenne.html#starting-serverruntime">Starting and Stopping ServerRuntime</a></span></dt><dt><span class="section"><a href="starting-cayenne.html#d0e1115">Merging Multiple Projects</a></span></dt><dt><span class="section"><a href="starting-cayenne.html#webapps">Web Applications</a></span></dt></dl></dd><dt><span class="chapter"><a href="persistent-objects-objectcontext.html">6. Persistent Objects and ObjectContext</a></span></dt><dd><dl><dt><span class="sec tion"><a href="persistent-objects-objectcontext.html#objectcontext">ObjectContext</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#persistent-lifecycle">Persistent Object and its Lifecycle</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#persistent-operations">ObjectContext Persistence API</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#cayenne-helper-class">Cayenne Helper Class</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#objectcontext-nesting">ObjectContext Nesting</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#generic-persistent-objects">Generic Persistent Objects</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#transactions">Transactions</a></span></dt></dl></dd><dt><span class="chapter"><a href="expressions.html">7. Expressions</a></span></d t><dd><dl><dt><span class="section"><a href="expressions.html#expressions-overview">Expressions Overview</a></span></dt><dt><span class="section"><a href="expressions.html#path-expressions">Path Expressions</a></span></dt><dt><span class="section"><a href="expressions.html#expressions-from-strings">Creating Expressions from Strings </a></span></dt><dt><span class="section"><a href="expressions.html#expressions-with-expressionfactory">Creating Expressions with API</a></span></dt><dt><span class="section"><a href="expressions.html#expressions-in-memory">Evaluating Expressions in Memory</a></span></dt><dt><span class="section"><a href="expressions.html#expressions-to-ejbql">Translating Expressions to EJBQL</a></span></dt></dl></dd><dt><span class="chapter"><a href="orderings.html">8. Orderings</a></span></dt><dt><span class="chapter"><a href="queries.html">9. Queries</a></span></dt><dd><dl><dt><span class="section"><a href="queries.html#selectquery">SelectQuery</a></span></dt><dt><span class="section"><a href="queries.html#ejbqlquery">EJBQLQuery</a></span></dt><dt><span class="section"><a href="queries.html#sqltemplate">SQLTemplate</a></span></dt><dt><span class="section"><a href="queries.html#procedurequery">ProcedureQuery</a></span></dt><dt><span class="section"><a href="queries.html#namedquery">NamedQuery</a></span></dt><dt><span class="section"><a href="queries.html#custom-queries">Custom Queries</a></span></dt></dl></dd><dt><span class="chapter"><a href="lifecycle-events.html">10. Lifecycle Events</a></span></dt><dd><dl><dt><span class="section"><a href="lifecycle-events.html#types-of-lifecycle-events">Types of Lifecycle Events</a></span></dt><dt><span class="section"><a href="lifecycle-events.html#callback-persistent">Callbacks on Persistent Objects</a></span></dt><dt><span class="section"><a href="lifecycle-events.html#callback-non-persistent">Callbacks on Non-Persistent Listeners</a></span></dt><dt><span class="section"><a href="lifecycle-events.html#comi ning-listeners-with-datachannelfilters">Combining Listeners with DataChannelFilters</a></span></dt></dl></dd><dt><span class="chapter"><a href="performance-tuning.html">11. Performance Tuning</a></span></dt><dd><dl><dt><span class="section"><a href="performance-tuning.html#prefetching">Prefetching</a></span></dt><dt><span class="section"><a href="performance-tuning.html#datarows">Data Rows</a></span></dt><dt><span class="section"><a href="performance-tuning.html#specific-attributes-with-ejbql">Specific Attributes and Relationships with EJBQL</a></span></dt><dt><span class="section"><a href="performance-tuning.html#iterated-queries">Iterated Queries</a></span></dt><dt><span class="section"><a href="performance-tuning.html#paginated-queries">Paginated Queries</a></span></dt><dt><span class="section"><a href="performance-tuning.html#caching-and-fresh-data">Caching and Fresh Data</a></span></dt><dt><span class="section"><a href="performance-tuning.html#turning-off-synchronization-of-obj ectcontexts">Turning off Synchronization of ObjectContexts</a></span></dt></dl></dd><dt><span class="chapter"><a href="customizing-cayenne-runtime.html">12. Customizing Cayenne Runtime</a></span></dt><dd><dl><dt><span class="section"><a href="customizing-cayenne-runtime.html#depdendency-injection-container">Dependency Injection Container</a></span></dt><dt><span class="section"><a href="customizing-cayenne-runtime.html#ways-to-customize-runtime"> Customization Strategies</a></span></dt><dt><span class="section"><a href="customizing-cayenne-runtime.html#noteworthy-runtime-components">Noteworthy Built-in Services</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="cayennemodeler-application.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="including-cayenne-in-project.html">Next</a></td></tr ><tr><td width="40%" align="left" >valign="top">Chapter 3. CayenneModeler Application </td><td >width="20%" align="center"><a accesskey="h" >href="index.html">Home</a></td><td width="40%" align="right" >valign="top"> Chapter 4. Including Cayenne in a >Project</td></tr></table></div></body></html> \ No newline at end of file + </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.M3-SNAPSHOT)</th><th align="center">Part II. Cayenne Framework</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="cayennemodeler-application.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="including-cayenne-in-project.html">Next</a></td></tr></table><hr></div><div class="part" title="Part II. Cayenne Framework"><div class="titlepage"><div><div><h1 class="title"><a name="cayenne-guide-part2"></a>Part II. Cayenne Framework</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="including-cayenne-in-project.html">4. Including Cayenne in a Project</a></sp an></dt><dd><dl><dt><span class="section"><a href="including-cayenne-in-project.html#jar-files-and-depdendencies">Jar Files and Dependencies</a></span></dt><dt><span class="section"><a href="including-cayenne-in-project.html#maven-projects">Maven Projects</a></span></dt><dt><span class="section"><a href="including-cayenne-in-project.html#ant-projects">Ant Projects</a></span></dt></dl></dd><dt><span class="chapter"><a href="starting-cayenne.html">5. Starting Cayenne</a></span></dt><dd><dl><dt><span class="section"><a href="starting-cayenne.html#starting-serverruntime">Starting and Stopping ServerRuntime</a></span></dt><dt><span class="section"><a href="starting-cayenne.html#d0e1115">Merging Multiple Projects</a></span></dt><dt><span class="section"><a href="starting-cayenne.html#webapps">Web Applications</a></span></dt></dl></dd><dt><span class="chapter"><a href="persistent-objects-objectcontext.html">6. Persistent Objects and ObjectContext</a></span></dt><dd><dl><dt><span class="sec tion"><a href="persistent-objects-objectcontext.html#objectcontext">ObjectContext</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#persistent-lifecycle">Persistent Object and its Lifecycle</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#persistent-operations">ObjectContext Persistence API</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#cayenne-helper-class">Cayenne Helper Class</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#objectcontext-nesting">ObjectContext Nesting</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#generic-persistent-objects">Generic Persistent Objects</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#transactions">Transactions</a></span></dt></dl></dd><dt><span class="chapter"><a href="expressions.html">7. Expressions</a></span></d t><dd><dl><dt><span class="section"><a href="expressions.html#expressions-overview">Expressions Overview</a></span></dt><dt><span class="section"><a href="expressions.html#path-expressions">Path Expressions</a></span></dt><dt><span class="section"><a href="expressions.html#expressions-from-strings">Creating Expressions from Strings </a></span></dt><dt><span class="section"><a href="expressions.html#expressions-with-expressionfactory">Creating Expressions with API</a></span></dt><dt><span class="section"><a href="expressions.html#expressions-in-memory">Evaluating Expressions in Memory</a></span></dt><dt><span class="section"><a href="expressions.html#expressions-to-ejbql">Translating Expressions to EJBQL</a></span></dt></dl></dd><dt><span class="chapter"><a href="orderings.html">8. Orderings</a></span></dt><dt><span class="chapter"><a href="queries.html">9. Queries</a></span></dt><dd><dl><dt><span class="section"><a href="queries.html#selectquery">ObjectSelect</a></span></dt><dt><spa n class="section"><a href="queries.html#ejbqlquery">EJBQLQuery</a></span></dt><dt><span class="section"><a href="queries.html#sqltemplate">SQLTemplate</a></span></dt><dt><span class="section"><a href="queries.html#procedurequery">ProcedureQuery</a></span></dt><dt><span class="section"><a href="queries.html#namedquery">NamedQuery</a></span></dt><dt><span class="section"><a href="queries.html#custom-queries">Custom Queries</a></span></dt></dl></dd><dt><span class="chapter"><a href="lifecycle-events.html">10. Lifecycle Events</a></span></dt><dd><dl><dt><span class="section"><a href="lifecycle-events.html#types-of-lifecycle-events">Types of Lifecycle Events</a></span></dt><dt><span class="section"><a href="lifecycle-events.html#callback-persistent">Callbacks on Persistent Objects</a></span></dt><dt><span class="section"><a href="lifecycle-events.html#callback-non-persistent">Callbacks on Non-Persistent Listeners</a></span></dt><dt><span class="section"><a href="lifecycle-events.html#com ining-listeners-with-datachannelfilters">Combining Listeners with DataChannelFilters</a></span></dt></dl></dd><dt><span class="chapter"><a href="performance-tuning.html">11. Performance Tuning</a></span></dt><dd><dl><dt><span class="section"><a href="performance-tuning.html#prefetching">Prefetching</a></span></dt><dt><span class="section"><a href="performance-tuning.html#datarows">Data Rows</a></span></dt><dt><span class="section"><a href="performance-tuning.html#specific-attributes-with-ejbql">Specific Attributes and Relationships with EJBQL</a></span></dt><dt><span class="section"><a href="performance-tuning.html#iterated-queries">Iterated Queries</a></span></dt><dt><span class="section"><a href="performance-tuning.html#paginated-queries">Paginated Queries</a></span></dt><dt><span class="section"><a href="performance-tuning.html#caching-and-fresh-data">Caching and Fresh Data</a></span></dt><dt><span class="section"><a href="performance-tuning.html#turning-off-synchronization-of-ob jectcontexts">Turning off Synchronization of ObjectContexts</a></span></dt></dl></dd><dt><span class="chapter"><a href="customizing-cayenne-runtime.html">12. Customizing Cayenne Runtime</a></span></dt><dd><dl><dt><span class="section"><a href="customizing-cayenne-runtime.html#depdendency-injection-container">Dependency Injection Container</a></span></dt><dt><span class="section"><a href="customizing-cayenne-runtime.html#ways-to-customize-runtime"> Customization Strategies</a></span></dt><dt><span class="section"><a href="customizing-cayenne-runtime.html#extendedtypes">Extended Types</a></span></dt><dt><span class="section"><a href="customizing-cayenne-runtime.html#noteworthy-runtime-components">Noteworthy Built-in Services</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="cayennemodeler-application.html">Prev</a> </td><td width="20%" align="center"> </ td><td width="40%" align="right"> <a accesskey="n" href="including-cayenne-in-project.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 3. CayenneModeler Application </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 4. Including Cayenne in a Project</td></tr></table></div></body></html> \ No newline at end of file Modified: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/configuration-properties.html URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/configuration-properties.html?rev=1728828&r1=1728827&r2=1728828&view=diff ============================================================================== --- cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/configuration-properties.html (original) +++ cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/configuration-properties.html Sat Feb 6 12:02:06 2016 @@ -11,7 +11,7 @@ })(); </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.M3-SNAPSHOT)</th><th align="center">Appendix A. Configuration Properties</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="current-limitations.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="service-collections.html">Next</a></td></tr></table><hr></div><div class="appendix" title="Appendix A. Configuration Properties"><div class="titlepage"><div><div><h2 class="title"><a name="configuration-properties"></a>Appendix A. Configuration Properties</h2></div></div></div><p>Note that the property names below are defined as constants in <code class="code">org.apache.cayenne.configuration.Constants</code> interface. </p><p> - </p><table frame="void" id="d0e2861"><caption>Table A.1. Configuration Properties Recognized by ServerRuntime and/or ClientRuntime</caption><col width="67%"><col width="15%"><col width="18%"><thead><tr> + </p><table frame="void" id="d0e2965"><caption>Table A.1. Configuration Properties Recognized by ServerRuntime and/or ClientRuntime</caption><col width="67%"><col width="15%"><col width="18%"><thead><tr> <th>Property</th> <th>Possible Values</th> <th>Default Value</th> Modified: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/customizing-cayenne-runtime.html URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/customizing-cayenne-runtime.html?rev=1728828&r1=1728827&r2=1728828&view=diff ============================================================================== --- cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/customizing-cayenne-runtime.html (original) +++ cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/customizing-cayenne-runtime.html Sat Feb 6 12:02:06 2016 @@ -9,7 +9,7 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); - </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.M3-SNAPSHOT)</th><th align="center">Chapter 12. Customizing Cayenne Runtime</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="performance-tuning.html">Prev</a> </td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part2.html">Part II. Cayenne Framework</a></th><td width="20%" align="right"> <a accesskey="n" href="cayenne-guide-part3.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 12. Customizing Cayenne Runtime"><div class="titlepage"><div><div><h2 class="title"><a name="customizing-cayenne-runtime"></a>Chapter 12. Customizing Cayenne Runtime</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p ><dl><dt><span class="section"><a >href="customizing-cayenne-runtime.html#depdendency-injection-container">Dependency > Injection Container</a></span></dt><dt><span class="section"><a >href="customizing-cayenne-runtime.html#ways-to-customize-runtime"> >Customization Strategies</a></span></dt><dt><span class="section"><a >href="customizing-cayenne-runtime.html#noteworthy-runtime-components">Noteworthy > Built-in Services</a></span></dt></dl></div><div class="section" >title="Dependency Injection Container"><div class="titlepage"><div><div><h2 >class="title"><a name="depdendency-injection-container"></a>Dependency >Injection Container</h2></div></div></div><p>Cayenne runtime is built around >a small powerful dependency injection (DI) container. Just + </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.M3-SNAPSHOT)</th><th align="center">Chapter 12. Customizing Cayenne Runtime</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="performance-tuning.html">Prev</a> </td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part2.html">Part II. Cayenne Framework</a></th><td width="20%" align="right"> <a accesskey="n" href="cayenne-guide-part3.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 12. Customizing Cayenne Runtime"><div class="titlepage"><div><div><h2 class="title"><a name="customizing-cayenne-runtime"></a>Chapter 12. Customizing Cayenne Runtime</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p ><dl><dt><span class="section"><a >href="customizing-cayenne-runtime.html#depdendency-injection-container">Dependency > Injection Container</a></span></dt><dt><span class="section"><a >href="customizing-cayenne-runtime.html#ways-to-customize-runtime"> >Customization Strategies</a></span></dt><dt><span class="section"><a >href="customizing-cayenne-runtime.html#extendedtypes">Extended >Types</a></span></dt><dt><span class="section"><a >href="customizing-cayenne-runtime.html#noteworthy-runtime-components">Noteworthy > Built-in Services</a></span></dt></dl></div><div class="section" >title="Dependency Injection Container"><div class="titlepage"><div><div><h2 >class="title"><a name="depdendency-injection-container"></a>Dependency >Injection Container</h2></div></div></div><p>Cayenne runtime is built around >a small powerful dependency injection (DI) container. Just like other popular DI technologies, such as Spring or Guice, Cayenne DI container manages sets of interdependent objects and allows users to configure them. These objects are regular Java objects. We are calling them "services" in this document to @@ -189,10 +189,109 @@ binder.bindList(DefaultDbAdapterFactory. implementation of this service is provided by <code class="code">MapQueryCacheProvider</code>. But if we want to use <code class="code">EhCacheQueryCache</code> (a Cayenne wrapper for the EhCache framework), we can define it like - this:</p><pre class="programlisting">binder.bind(QueryCache.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).to(EhCacheQueryCache.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>);</pre></div></div><div class="section" title="Noteworthy Built-in Services"><div class="titlepage"><div><div><h2 class="title"><a name="noteworthy-runtime-components"></a>Noteworthy Built-in Services</h2></div></div></div><div class="section" title="JdbcEventLogger"><div class="titlepage"><div><div><h3 class="title"><a name="jdbceventlogger"></a>JdbcEventLogger</h3></div></div></div><p><code class="code">org.apache.cayenne.log.JdbcEventLogger</code> is the service that defines + this:</p><pre class="programlisting">binder.bind(QueryCache.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).to(EhCacheQueryCache.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>);</pre></div></div><div class="section" title="Extended Types"><div class="titlepage"><div><div><h2 class="title"><a name="extendedtypes"></a>Extended Types</h2></div></div></div><p>JDBC specification defines a set of "standard" database column types (defined in java.sql.Types class) + and a very specific mapping of these types to Java Object Types, such as java.lang.String, + java.math.BigDecimal, etc. Sometimes there is a need to use a custom Java type not known to JDBC driver and + Cayenne allows to configure it. For this Cayenne needs to know how to instantiate this type from + a database "primitive" value, and conversely, how to transform an object of the custom type to + a JDBC-compatible object.</p><div class="section" title="Supporting Non-Standard Types"><div class="titlepage"><div><div><h3 class="title"><a name="supporting-non-standard-types"></a>Supporting Non-Standard Types</h3></div></div></div><p>For supporting non-standard type you should define it via an interface <code class="code">org.apache.cayenne.access.types.ExtendedType</code>. + An implementation must provide <code class="code">ExtendedType.getClassName()</code> method that returns + a fully qualified Java class name for the supported custom type, and a number of methods + that convert data between JDBC and custom type. + The following example demonstrates how to add a custom DoubleArrayType + to store java.lang.Double[] as a custom string in a database:</p><pre class="programlisting"> +<strong xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">/** +* Defines methods to read Java objects from JDBC ResultSets and write as parameters of +* PreparedStatements. +*/</strong> +<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span> DoubleArrayType <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">implements</span> ExtendedType { + + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">private</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">final</span> String SEPARATOR = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">","</span>; + + <strong xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">/** + * Returns a full name of Java class that this ExtendedType supports. + */</strong> + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Override</span> + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> String getClassName() { + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">return</span> Double[].<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>.getCanonicalName(); + } + + <strong xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">/** + * Initializes a single parameter of a PreparedStatement with object value. + */</strong> + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Override</span> + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">void</span> setJdbcObject(PreparedStatement statement, Object value, + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> pos, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> type, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> scale) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">throws</span> Exception { + + String str = StringUtils.join((Double[]) value, SEPARATOR); + statement.setString(pos, str); + } + + + <strong xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">/** + * Reads an object from JDBC ResultSet column, converting it to class returned by + * 'getClassName' method. + * + * @throws Exception if read error occurred, or an object can't be converted to a + * target Java class. + */</strong> + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Override</span> + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> Object materializeObject(ResultSet rs, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> index, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> type) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">throws</span> Exception { + String[] str = rs.getString(index).split(SEPARATOR); + Double[] res = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> Double[str.length]; + + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">for</span> (<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> i = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">0</span>; i < str.length; i++) { + res[i] = Double.valueOf(str[i]); + } + + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">return</span> res; + } + + <strong xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">/** + * Reads an object from a stored procedure OUT parameter, converting it to class + * returned by 'getClassName' method. + * + * @throws Exception if read error ocurred, or an object can't be converted to a + * target Java class. + */</strong> + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Override</span> + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> Object materializeObject(CallableStatement rs, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> index, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> type) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">throws</span> Exception { + String[] str = rs.getString(index).split(SEPARATOR); + Double[] res = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> Double[str.length]; + + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">for</span> (<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> i = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">0</span>; i < str.length; i++) { + res[i] = Double.valueOf(str[i]); + } + + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">return</span> res; + } +} + </pre><p>For Java7</p><pre class="programlisting"> +<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// add DoubleArrayType to list of user types</span> +ServerRuntime runtime = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> ServerRuntime(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"cayenne-project.xml"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> Module() { + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Override</span> + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">void</span> configure(Binder binder) { + binder + .bindList(Constants.SERVER_USER_TYPES_LIST) + .add(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> DoubleArrayType()); + } +}); + </pre><p>For Java8</p><pre class="programlisting"> +<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// add DoubleArrayType to list of user types</span> +ServerRuntime runtime = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> ServerRuntime(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"cayenne-project.xml"</span>, + (Binder binder) -> binder.bindList(Constants.SERVER_USER_TYPES_LIST) + .add(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> DoubleArrayType())); + </pre><p>More examples of implementation you can find in + <a class="link" href="https://github.com/apache/cayenne/tree/master/cayenne-java8" target="_top">cayenne-java8 module</a> or + <a class="link" href="https://github.com/apache/cayenne/tree/master/cayenne-joda" target="_top">cayenne-joda module</a>.</p></div><div class="section" title="DbAdapters and Extended Types"><div class="titlepage"><div><div><h3 class="title"><a name="dbadapters-and-extended-types"></a>DbAdapters and Extended Types</h3></div></div></div><p>As shown in the example above, ExtendedTypes are stored by DbAdapter. In fact DbAdapters often install + their own extended types to address incompatibilities, incompleteness and differences between + JDBC drivers in handling "standard" JDBC types. For instance some drivers support reading large + character columns (CLOB) as java.sql.Clob, but some other - as "character stream", etc. + Adapters provided with Cayenne override <code class="code">configureExtendedTypes()</code> method to install their own types, + possibly substituting Cayenne defaults. Custom DbAdapters can use the same technique.</p></div></div><div class="section" title="Noteworthy Built-in Services"><div class="titlepage"><div><div><h2 class="title"><a name="noteworthy-runtime-components"></a>Noteworthy Built-in Services</h2></div></div></div><div class="section" title="JdbcEventLogger"><div class="titlepage"><div><div><h3 class="title"><a name="jdbceventlogger"></a>JdbcEventLogger</h3></div></div></div><p><code class="code">org.apache.cayenne.log.JdbcEventLogger</code> is the service that defines logging API for Cayenne internals. It provides facilities for logging queries, commits, transactions, etc. The default implementation is <code class="code">org.apache.cayenne.log.CommonsJdbcEventLogger</code> that performs logging via commons-logging library. Cayenne library includes another potentially useful logger - <code class="code">org.apache.cayenne.log.FormattedCommonsJdbcEventLogger</code> that - produces formatted multiline SQL output that can be easier to read.</p></div><div class="section" title="DataSourceFactory"><div class="titlepage"><div><div><h3 class="title"><a name="datasourcefactory"></a>DataSourceFactory</h3></div></div></div></div><div class="section" title="DataChannelFilter"><div class="titlepage"><div><div><h3 class="title"><a name="datachannelfilter"></a>DataChannelFilter</h3></div></div></div></div><div class="section" title="QueryCache"><div class="titlepage"><div><div><h3 class="title"><a name="querycache"></a>QueryCache</h3></div></div></div></div><div class="section" title="ExtendedTypes"><div class="titlepage"><div><div><h3 class="title"><a name="extendedtypes"></a>ExtendedTypes</h3></div></div></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="performance-tuning.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u " href="cayenne-guide-part2.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="cayenne-guide-part3.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 11. Performance Tuning </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Part III. Cayenne Framework - Remote Object Persistence </td></tr></table></div></body></html> \ No newline at end of file + produces formatted multiline SQL output that can be easier to read.</p></div><div class="section" title="DataSourceFactory"><div class="titlepage"><div><div><h3 class="title"><a name="datasourcefactory"></a>DataSourceFactory</h3></div></div></div></div><div class="section" title="DataChannelFilter"><div class="titlepage"><div><div><h3 class="title"><a name="datachannelfilter"></a>DataChannelFilter</h3></div></div></div></div><div class="section" title="QueryCache"><div class="titlepage"><div><div><h3 class="title"><a name="querycache"></a>QueryCache</h3></div></div></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="performance-tuning.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="cayenne-guide-part2.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="cayenne-guide-part3.html">Next</a></td></tr><tr><td width="4 0%" align="left" valign="top">Chapter 11. Performance Tuning </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Part III. Cayenne Framework - Remote Object Persistence </td></tr></table></div></body></html> \ No newline at end of file Modified: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/index.html URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/index.html?rev=1728828&r1=1728827&r2=1728828&view=diff ============================================================================== --- cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/index.html (original) +++ cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/index.html Sat Feb 6 12:02:06 2016 @@ -17,4 +17,4 @@ http://www.apache.org/licenses/LICENSE-2.0</p><p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License.</p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="part"><a href="cayenne-guide-part1.html">I. Object Relational Mapping with Cayenne</a></span></dt><dd><dl><dt><span class="chapter"><a href="setup.html">1. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="setup.html#system-requirements">System Requirements</a></span></dt><dt><span class="section"><a href="setup.html#running-cayennemodeler">Running CayenneModeler</a></span></dt></dl></dd><dt><span class="chapter"><a href="cayenne-mapping-structure.html">2. Cayenne Mapping Structure</a></span></dt><dd><dl><dt><span class="section"><a href="cayenne-mapping-structure.html#cayenne-project">Cayenne Project</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#datamap">DataMap</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#datanode">Dat aNode</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#dbentity">DbEntity</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#objentity">ObjEntity</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#embeddable">Embeddable</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#procedure">Procedure</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#query">Query</a></span></dt></dl></dd><dt><span class="chapter"><a href="cayennemodeler-application.html">3. CayenneModeler Application</a></span></dt><dd><dl><dt><span class="section"><a href="cayennemodeler-application.html#working-with-mapping-projects">Working with Mapping Projects</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#reverse-engineering-database">Reverse Engineering Database</a></span></dt><dt><span class="section"><a href="cayennemodeler-applicati on.html#generating-database-schema">Generating Database Schema</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#migrations">Migrations</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#generating-java-classes">Generating Java Classes</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#modeling-inheritance">Modeling Inheritance</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#modeling-generic-persistence-classes">Modeling Generic Persistent Classes</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#mapping-objattributes-to-custom-classes">Mapping ObjAttributes to Custom Classes</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#modeling-pk-generation-strategy">Modeling Primary Key Generation Strategy</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="cayenne-guide-part2.html">II. C ayenne Framework</a></span></dt><dd><dl><dt><span class="chapter"><a href="including-cayenne-in-project.html">4. Including Cayenne in a Project</a></span></dt><dd><dl><dt><span class="section"><a href="including-cayenne-in-project.html#jar-files-and-depdendencies">Jar Files and Dependencies</a></span></dt><dt><span class="section"><a href="including-cayenne-in-project.html#maven-projects">Maven Projects</a></span></dt><dt><span class="section"><a href="including-cayenne-in-project.html#ant-projects">Ant Projects</a></span></dt></dl></dd><dt><span class="chapter"><a href="starting-cayenne.html">5. Starting Cayenne</a></span></dt><dd><dl><dt><span class="section"><a href="starting-cayenne.html#starting-serverruntime">Starting and Stopping ServerRuntime</a></span></dt><dt><span class="section"><a href="starting-cayenne.html#d0e1115">Merging Multiple Projects</a></span></dt><dt><span class="section"><a href="starting-cayenne.html#webapps">Web Applications</a></span></dt></dl></dd><dt><s pan class="chapter"><a href="persistent-objects-objectcontext.html">6. Persistent Objects and ObjectContext</a></span></dt><dd><dl><dt><span class="section"><a href="persistent-objects-objectcontext.html#objectcontext">ObjectContext</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#persistent-lifecycle">Persistent Object and its Lifecycle</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#persistent-operations">ObjectContext Persistence API</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#cayenne-helper-class">Cayenne Helper Class</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#objectcontext-nesting">ObjectContext Nesting</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#generic-persistent-objects">Generic Persistent Objects</a></span></dt><dt><span class="section"><a href="persistent-objects-o bjectcontext.html#transactions">Transactions</a></span></dt></dl></dd><dt><span class="chapter"><a href="expressions.html">7. Expressions</a></span></dt><dd><dl><dt><span class="section"><a href="expressions.html#expressions-overview">Expressions Overview</a></span></dt><dt><span class="section"><a href="expressions.html#path-expressions">Path Expressions</a></span></dt><dt><span class="section"><a href="expressions.html#expressions-from-strings">Creating Expressions from Strings </a></span></dt><dt><span class="section"><a href="expressions.html#expressions-with-expressionfactory">Creating Expressions with API</a></span></dt><dt><span class="section"><a href="expressions.html#expressions-in-memory">Evaluating Expressions in Memory</a></span></dt><dt><span class="section"><a href="expressions.html#expressions-to-ejbql">Translating Expressions to EJBQL</a></span></dt></dl></dd><dt><span class="chapter"><a href="orderings.html">8. Orderings</a></span></dt><dt><span class="chapter"><a href="queries.html">9. Queries</a></span></dt><dd><dl><dt><span class="section"><a href="queries.html#selectquery">SelectQuery</a></span></dt><dt><span class="section"><a href="queries.html#ejbqlquery">EJBQLQuery</a></span></dt><dt><span class="section"><a href="queries.html#sqltemplate">SQLTemplate</a></span></dt><dt><span class="section"><a href="queries.html#procedurequery">ProcedureQuery</a></span></dt><dt><span class="section"><a href="queries.html#namedquery">NamedQuery</a></span></dt><dt><span class="section"><a href="queries.html#custom-queries">Custom Queries</a></span></dt></dl></dd><dt><span class="chapter"><a href="lifecycle-events.html">10. Lifecycle Events</a></span></dt><dd><dl><dt><span class="section"><a href="lifecycle-events.html#types-of-lifecycle-events">Types of Lifecycle Events</a></span></dt><dt><span class="section"><a href="lifecycle-events.html#callback-persistent">Callbacks on Persistent Objects</a></span></dt><dt><span class="section"><a href="lifecycle- events.html#callback-non-persistent">Callbacks on Non-Persistent Listeners</a></span></dt><dt><span class="section"><a href="lifecycle-events.html#comining-listeners-with-datachannelfilters">Combining Listeners with DataChannelFilters</a></span></dt></dl></dd><dt><span class="chapter"><a href="performance-tuning.html">11. Performance Tuning</a></span></dt><dd><dl><dt><span class="section"><a href="performance-tuning.html#prefetching">Prefetching</a></span></dt><dt><span class="section"><a href="performance-tuning.html#datarows">Data Rows</a></span></dt><dt><span class="section"><a href="performance-tuning.html#specific-attributes-with-ejbql">Specific Attributes and Relationships with EJBQL</a></span></dt><dt><span class="section"><a href="performance-tuning.html#iterated-queries">Iterated Queries</a></span></dt><dt><span class="section"><a href="performance-tuning.html#paginated-queries">Paginated Queries</a></span></dt><dt><span class="section"><a href="performance-tuning.html#cach ing-and-fresh-data">Caching and Fresh Data</a></span></dt><dt><span class="section"><a href="performance-tuning.html#turning-off-synchronization-of-objectcontexts">Turning off Synchronization of ObjectContexts</a></span></dt></dl></dd><dt><span class="chapter"><a href="customizing-cayenne-runtime.html">12. Customizing Cayenne Runtime</a></span></dt><dd><dl><dt><span class="section"><a href="customizing-cayenne-runtime.html#depdendency-injection-container">Dependency Injection Container</a></span></dt><dt><span class="section"><a href="customizing-cayenne-runtime.html#ways-to-customize-runtime"> Customization Strategies</a></span></dt><dt><span class="section"><a href="customizing-cayenne-runtime.html#noteworthy-runtime-components">Noteworthy Built-in Services</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="cayenne-guide-part3.html">III. Cayenne Framework - Remote Object Persistence </a></span></dt><dd><dl><dt><span class="chapter"><a href="introduction-to-rop.html ">13. Introduction to ROP</a></span></dt><dd><dl><dt><span class="section"><a href="introduction-to-rop.html#what-is-rop">What is ROP</a></span></dt><dt><span class="section"><a href="introduction-to-rop.html#main-features">Main Features</a></span></dt></dl></dd><dt><span class="chapter"><a href="rop-setup.html">14. ROP Setup</a></span></dt><dd><dl><dt><span class="section"><a href="rop-setup.html#rop-system-requirements">System Requirements</a></span></dt><dt><span class="section"><a href="rop-setup.html#rop-jar-files-dependencies">Jar Files and Dependencies</a></span></dt></dl></dd><dt><span class="chapter"><a href="implementing-rop-server.html">15. Implementing ROP Server</a></span></dt><dt><span class="chapter"><a href="implementing-rop-client.html">16. Implementing ROP Client</a></span></dt><dt><span class="chapter"><a href="rop-deployment.html">17. ROP Deployment</a></span></dt><dd><dl><dt><span class="section"><a href="rop-deployment.html#deploying-rop-server">Deploying ROP S erver</a></span></dt><dt><span class="section"><a href="rop-deployment.html#deploying-rop-client">Deploying ROP Client</a></span></dt><dt><span class="section"><a href="rop-deployment.html#rop-security">Security</a></span></dt></dl></dd><dt><span class="chapter"><a href="current-limitations.html">18. Current Limitations</a></span></dt></dl></dd><dt><span class="appendix"><a href="configuration-properties.html">A. Configuration Properties</a></span></dt><dt><span class="appendix"><a href="service-collections.html">B. Service Collections</a></span></dt><dt><span class="appendix"><a href="expressions-bnf.html">C. Expressions BNF</a></span></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>1.1. <a href="setup.html#d0e37">Cayenne Version History</a></dt><dt>4.1. <a href="including-cayenne-in-project.html#d0e342">cgen required parameters</a></dt><dt>4.2. <a href="including-cayenne-in-project.html#d0e377">cgen optional parameters</a></dt><dt>4.3. <a href="inclu ding-cayenne-in-project.html#d0e602">cdbgen required parameters</a></dt><dt>4.4. <a href="including-cayenne-in-project.html#d0e662">cdbgen optional parameters</a></dt><dt>4.5. <a href="including-cayenne-in-project.html#d0e793">cdbimport required parameters</a></dt><dt>4.6. <a href="including-cayenne-in-project.html#d0e854">cdbimport optional parameters</a></dt><dt>6.1. <a href="persistent-objects-objectcontext.html#d0e1214">Persistence States</a></dt><dt>10.1. <a href="lifecycle-events.html#d0e2144">Lifecycle Event Types</a></dt><dt>A.1. <a href="configuration-properties.html#d0e2861">Configuration Properties Recognized by ServerRuntime and/or ClientRuntime</a></dt><dt>B.1. <a href="service-collections.html#d0e3135">Service Collection Keys Present in ServerRuntime and/or ClientRuntime</a></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="cayenne-guide-part1.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Part I. Object Relational Mapping with Cayenne</td></tr></table></div></body></html> \ No newline at end of file + language governing permissions and limitations under the License.</p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="part"><a href="cayenne-guide-part1.html">I. Object Relational Mapping with Cayenne</a></span></dt><dd><dl><dt><span class="chapter"><a href="setup.html">1. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="setup.html#system-requirements">System Requirements</a></span></dt><dt><span class="section"><a href="setup.html#running-cayennemodeler">Running CayenneModeler</a></span></dt></dl></dd><dt><span class="chapter"><a href="cayenne-mapping-structure.html">2. Cayenne Mapping Structure</a></span></dt><dd><dl><dt><span class="section"><a href="cayenne-mapping-structure.html#cayenne-project">Cayenne Project</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#datamap">DataMap</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#datanode">Dat aNode</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#dbentity">DbEntity</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#objentity">ObjEntity</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#embeddable">Embeddable</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#procedure">Procedure</a></span></dt><dt><span class="section"><a href="cayenne-mapping-structure.html#query">Query</a></span></dt></dl></dd><dt><span class="chapter"><a href="cayennemodeler-application.html">3. CayenneModeler Application</a></span></dt><dd><dl><dt><span class="section"><a href="cayennemodeler-application.html#working-with-mapping-projects">Working with Mapping Projects</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#reverse-engineering-database">Reverse Engineering Database</a></span></dt><dt><span class="section"><a href="cayennemodeler-applicati on.html#generating-database-schema">Generating Database Schema</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#migrations">Migrations</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#generating-java-classes">Generating Java Classes</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#modeling-inheritance">Modeling Inheritance</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#modeling-generic-persistence-classes">Modeling Generic Persistent Classes</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#mapping-objattributes-to-custom-classes">Mapping ObjAttributes to Custom Classes</a></span></dt><dt><span class="section"><a href="cayennemodeler-application.html#modeling-pk-generation-strategy">Modeling Primary Key Generation Strategy</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="cayenne-guide-part2.html">II. C ayenne Framework</a></span></dt><dd><dl><dt><span class="chapter"><a href="including-cayenne-in-project.html">4. Including Cayenne in a Project</a></span></dt><dd><dl><dt><span class="section"><a href="including-cayenne-in-project.html#jar-files-and-depdendencies">Jar Files and Dependencies</a></span></dt><dt><span class="section"><a href="including-cayenne-in-project.html#maven-projects">Maven Projects</a></span></dt><dt><span class="section"><a href="including-cayenne-in-project.html#ant-projects">Ant Projects</a></span></dt></dl></dd><dt><span class="chapter"><a href="starting-cayenne.html">5. Starting Cayenne</a></span></dt><dd><dl><dt><span class="section"><a href="starting-cayenne.html#starting-serverruntime">Starting and Stopping ServerRuntime</a></span></dt><dt><span class="section"><a href="starting-cayenne.html#d0e1115">Merging Multiple Projects</a></span></dt><dt><span class="section"><a href="starting-cayenne.html#webapps">Web Applications</a></span></dt></dl></dd><dt><s pan class="chapter"><a href="persistent-objects-objectcontext.html">6. Persistent Objects and ObjectContext</a></span></dt><dd><dl><dt><span class="section"><a href="persistent-objects-objectcontext.html#objectcontext">ObjectContext</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#persistent-lifecycle">Persistent Object and its Lifecycle</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#persistent-operations">ObjectContext Persistence API</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#cayenne-helper-class">Cayenne Helper Class</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#objectcontext-nesting">ObjectContext Nesting</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#generic-persistent-objects">Generic Persistent Objects</a></span></dt><dt><span class="section"><a href="persistent-objects-o bjectcontext.html#transactions">Transactions</a></span></dt></dl></dd><dt><span class="chapter"><a href="expressions.html">7. Expressions</a></span></dt><dd><dl><dt><span class="section"><a href="expressions.html#expressions-overview">Expressions Overview</a></span></dt><dt><span class="section"><a href="expressions.html#path-expressions">Path Expressions</a></span></dt><dt><span class="section"><a href="expressions.html#expressions-from-strings">Creating Expressions from Strings </a></span></dt><dt><span class="section"><a href="expressions.html#expressions-with-expressionfactory">Creating Expressions with API</a></span></dt><dt><span class="section"><a href="expressions.html#expressions-in-memory">Evaluating Expressions in Memory</a></span></dt><dt><span class="section"><a href="expressions.html#expressions-to-ejbql">Translating Expressions to EJBQL</a></span></dt></dl></dd><dt><span class="chapter"><a href="orderings.html">8. Orderings</a></span></dt><dt><span class="chapter"><a href="queries.html">9. Queries</a></span></dt><dd><dl><dt><span class="section"><a href="queries.html#selectquery">ObjectSelect</a></span></dt><dt><span class="section"><a href="queries.html#ejbqlquery">EJBQLQuery</a></span></dt><dt><span class="section"><a href="queries.html#sqltemplate">SQLTemplate</a></span></dt><dt><span class="section"><a href="queries.html#procedurequery">ProcedureQuery</a></span></dt><dt><span class="section"><a href="queries.html#namedquery">NamedQuery</a></span></dt><dt><span class="section"><a href="queries.html#custom-queries">Custom Queries</a></span></dt></dl></dd><dt><span class="chapter"><a href="lifecycle-events.html">10. Lifecycle Events</a></span></dt><dd><dl><dt><span class="section"><a href="lifecycle-events.html#types-of-lifecycle-events">Types of Lifecycle Events</a></span></dt><dt><span class="section"><a href="lifecycle-events.html#callback-persistent">Callbacks on Persistent Objects</a></span></dt><dt><span class="section"><a href="lifecycle -events.html#callback-non-persistent">Callbacks on Non-Persistent Listeners</a></span></dt><dt><span class="section"><a href="lifecycle-events.html#comining-listeners-with-datachannelfilters">Combining Listeners with DataChannelFilters</a></span></dt></dl></dd><dt><span class="chapter"><a href="performance-tuning.html">11. Performance Tuning</a></span></dt><dd><dl><dt><span class="section"><a href="performance-tuning.html#prefetching">Prefetching</a></span></dt><dt><span class="section"><a href="performance-tuning.html#datarows">Data Rows</a></span></dt><dt><span class="section"><a href="performance-tuning.html#specific-attributes-with-ejbql">Specific Attributes and Relationships with EJBQL</a></span></dt><dt><span class="section"><a href="performance-tuning.html#iterated-queries">Iterated Queries</a></span></dt><dt><span class="section"><a href="performance-tuning.html#paginated-queries">Paginated Queries</a></span></dt><dt><span class="section"><a href="performance-tuning.html#cac hing-and-fresh-data">Caching and Fresh Data</a></span></dt><dt><span class="section"><a href="performance-tuning.html#turning-off-synchronization-of-objectcontexts">Turning off Synchronization of ObjectContexts</a></span></dt></dl></dd><dt><span class="chapter"><a href="customizing-cayenne-runtime.html">12. Customizing Cayenne Runtime</a></span></dt><dd><dl><dt><span class="section"><a href="customizing-cayenne-runtime.html#depdendency-injection-container">Dependency Injection Container</a></span></dt><dt><span class="section"><a href="customizing-cayenne-runtime.html#ways-to-customize-runtime"> Customization Strategies</a></span></dt><dt><span class="section"><a href="customizing-cayenne-runtime.html#extendedtypes">Extended Types</a></span></dt><dt><span class="section"><a href="customizing-cayenne-runtime.html#noteworthy-runtime-components">Noteworthy Built-in Services</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="cayenne-guide-part3.html">III. Cayenne Framewo rk - Remote Object Persistence </a></span></dt><dd><dl><dt><span class="chapter"><a href="introduction-to-rop.html">13. Introduction to ROP</a></span></dt><dd><dl><dt><span class="section"><a href="introduction-to-rop.html#what-is-rop">What is ROP</a></span></dt><dt><span class="section"><a href="introduction-to-rop.html#main-features">Main Features</a></span></dt></dl></dd><dt><span class="chapter"><a href="rop-setup.html">14. ROP Setup</a></span></dt><dd><dl><dt><span class="section"><a href="rop-setup.html#rop-system-requirements">System Requirements</a></span></dt><dt><span class="section"><a href="rop-setup.html#rop-jar-files-dependencies">Jar Files and Dependencies</a></span></dt></dl></dd><dt><span class="chapter"><a href="implementing-rop-server.html">15. Implementing ROP Server</a></span></dt><dt><span class="chapter"><a href="implementing-rop-client.html">16. Implementing ROP Client</a></span></dt><dt><span class="chapter"><a href="rop-deployment.html">17. ROP Deployment</ a></span></dt><dd><dl><dt><span class="section"><a href="rop-deployment.html#deploying-rop-server">Deploying ROP Server</a></span></dt><dt><span class="section"><a href="rop-deployment.html#deploying-rop-client">Deploying ROP Client</a></span></dt><dt><span class="section"><a href="rop-deployment.html#rop-security">Security</a></span></dt></dl></dd><dt><span class="chapter"><a href="current-limitations.html">18. Current Limitations</a></span></dt></dl></dd><dt><span class="appendix"><a href="configuration-properties.html">A. Configuration Properties</a></span></dt><dt><span class="appendix"><a href="service-collections.html">B. Service Collections</a></span></dt><dt><span class="appendix"><a href="expressions-bnf.html">C. Expressions BNF</a></span></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>1.1. <a href="setup.html#d0e37">Cayenne Version History</a></dt><dt>4.1. <a href="including-cayenne-in-project.html#d0e342">cgen required parameters</a></dt><d t>4.2. <a href="including-cayenne-in-project.html#d0e377">cgen optional parameters</a></dt><dt>4.3. <a href="including-cayenne-in-project.html#d0e602">cdbgen required parameters</a></dt><dt>4.4. <a href="including-cayenne-in-project.html#d0e662">cdbgen optional parameters</a></dt><dt>4.5. <a href="including-cayenne-in-project.html#d0e793">cdbimport required parameters</a></dt><dt>4.6. <a href="including-cayenne-in-project.html#d0e854">cdbimport optional parameters</a></dt><dt>6.1. <a href="persistent-objects-objectcontext.html#d0e1214">Persistence States</a></dt><dt>10.1. <a href="lifecycle-events.html#d0e2149">Lifecycle Event Types</a></dt><dt>A.1. <a href="configuration-properties.html#d0e2965">Configuration Properties Recognized by ServerRuntime and/or ClientRuntime</a></dt><dt>B.1. <a href="service-collections.html#d0e3239">Service Collection Keys Present in ServerRuntime and/or ClientRuntime</a></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Naviga tion footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="cayenne-guide-part1.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Part I. Object Relational Mapping with Cayenne</td></tr></table></div></body></html> \ No newline at end of file Modified: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/lifecycle-events.html URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/lifecycle-events.html?rev=1728828&r1=1728827&r2=1728828&view=diff ============================================================================== --- cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/lifecycle-events.html (original) +++ cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/lifecycle-events.html Sat Feb 6 12:02:06 2016 @@ -25,7 +25,7 @@ evnironment outside Cayenne. This power comes from such features as filtering which entity events are sent to a given listener and the ability to create a common operation context for multiple callback invocations. All of these are discussed later in this chapter.</p><div class="section" title="Types of Lifecycle Events"><div class="titlepage"><div><div><h2 class="title"><a name="types-of-lifecycle-events"></a>Types of Lifecycle Events</h2></div></div></div><p>Cayenne defines the following 8 types of lifecycle events for which callbacks can be - regsitered:</p><table frame="void" id="d0e2144"><caption>Table 10.1. Lifecycle Event Types</caption><col width="16%"><col width="84%"><thead><tr> + regsitered:</p><table frame="void" id="d0e2149"><caption>Table 10.1. Lifecycle Event Types</caption><col width="16%"><col width="84%"><thead><tr> <th>Event</th> <th>Occurs...</th> </tr></thead><tbody><tr> @@ -38,13 +38,13 @@ <td>PrePersist</td> <td>right before a new object is committed, inside <code class="code">ObjectContext.commitChanges()</code> and - <code class="code">ObjectContext.commitChangesToParent()</code> (and prior to + <code class="code">ObjectContext.commitChangesToParent()</code> (and after "<code class="code">validateForInsert()</code>").</td> </tr><tr> <td>PreUpdate</td> <td>right before a modified object is committed, inside <code class="code">ObjectContext.commitChanges()</code> and - <code class="code">ObjectContext.commitChangesToParent()</code> (and prior to + <code class="code">ObjectContext.commitChangesToParent()</code> (and after "<code class="code">validateForUpdate()</code>").</td> </tr><tr> <td>PreRemove</td> Modified: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/performance-tuning.html URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/performance-tuning.html?rev=1728828&r1=1728827&r2=1728828&view=diff ============================================================================== --- cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/performance-tuning.html (original) +++ cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/performance-tuning.html Sat Feb 6 12:02:06 2016 @@ -122,29 +122,31 @@ DataContext dataContext = (DataContext) are two styles of accessing ResultIterator - direct access which requires explicit closing to avoid JDBC resources leak, or a callback that lets Cayenne handle resource management. In both cases iteration can be performed using "for" loop, as ResultIterator - is "Iterable".</p><p>Direct access. Here common sense tells us that ResultIterators instances should be + is "Iterable".</p><p>Direct access. Here common sense tells us that ResultIterators instances should be processed and closed as soon as possible to release the DB connection. E.g. storing open iterators between HTTP requests for unpredictable length of time would quickly exhaust the connection - pool.</p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// create a regular query</span> -SelectQuery<Artist> q = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SelectQuery<Artist>(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>); - -ResultIterator<Artist> it = context.iterator(q); -<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">try</span> { + pool.</p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">try</span>(ResultIterator<Artist> it = ObjectSelect.query(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).iterator(context)) { <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">for</span>(Artist a : it) { <span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// do something with the object...</span> ... } -} -<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">finally</span> { - it.close(); }</pre><p>Same thing with a - callback:</p><pre class="programlisting">SelectQuery<Artist> q = new SelectQuery<Artist>(Artist.class); - -context.iterate(q, (Artist a) -> { + callback:</p><pre class="programlisting">ObjectSelect.query(Artist.class).iterate(context, (Artist a) -> { // do something with the object... ... -});</pre></div><div class="section" title="Paginated Queries"><div class="titlepage"><div><div><h2 class="title"><a name="paginated-queries"></a>Paginated Queries</h2></div></div></div><p>Enabling query pagination allows to load very large result sets in a Java app with +});</pre><p>Another example is a BatchIterator that allows to process more than one object in each + iteration. This is a common scenario in various data processing jobs - read a batch of + objects, process them, commit the results, and then repeat. This allows to further + optimize processing (e.g. by avoiding frequent + commits).</p><pre class="programlisting">try(ResultBatchIterator<Artist> it = ObjectSelect.query(Artist.class).iterator(context)) { + for(List<Artist> list : it) { + // do something with each list + ... + // possibly commit your changes + context.commitChanges(); + } +}</pre></div><div class="section" title="Paginated Queries"><div class="titlepage"><div><div><h2 class="title"><a name="paginated-queries"></a>Paginated Queries</h2></div></div></div><p>Enabling query pagination allows to load very large result sets in a Java app with very little memory overhead (much smaller than even the DataRows option discussed above). Moreover it is completely transparent to the application - a user gets what appears to be a list of Persistent objects - there's no iterator to close or DataRows to @@ -170,7 +172,64 @@ List<DataRow> rows = ctxt.performQ still a very useful approach. With some lists (e.g. multi-page search results) only a few top objects are normally accessed. At the same time pagination allows to estimate the full list size without fetching all the objects. And again - it is completely - transparent and looks like a normal query.</p></div><div class="section" title="Caching and Fresh Data"><div class="titlepage"><div><div><h2 class="title"><a name="caching-and-fresh-data"></a>Caching and Fresh Data</h2></div></div></div><div class="section" title="Object Caching"><div class="titlepage"><div><div><h3 class="title"><a name="object-caching"></a>Object Caching</h3></div></div></div></div><div class="section" title="Query Result Caching"><div class="titlepage"><div><div><h3 class="title"><a name="query-result-caching"></a>Query Result Caching</h3></div></div></div></div></div><div class="section" title="Turning off Synchronization of ObjectContexts"><div class="titlepage"><div><div><h2 class="title"><a name="turning-off-synchronization-of-objectcontexts"></a>Turning off Synchronization of ObjectContexts</h2></div></div></div><p>By default when a single ObjectContext commits its changes, all other contexts in the + transparent and looks like a normal query.</p></div><div class="section" title="Caching and Fresh Data"><div class="titlepage"><div><div><h2 class="title"><a name="caching-and-fresh-data"></a>Caching and Fresh Data</h2></div></div></div><div class="section" title="Object Caching"><div class="titlepage"><div><div><h3 class="title"><a name="object-caching"></a>Object Caching</h3></div></div></div></div><div class="section" title="Query Result Caching"><div class="titlepage"><div><div><h3 class="title"><a name="query-result-caching"></a>Query Result Caching</h3></div></div></div><p>Cayenne supports mostly transparent caching of the query results. There are two + levels of the cache: local (i.e. results cached by the ObjectContext) and shared + (i.e. the results cached at the stack level and shared between all contexts). Local + cache is much faster then the shared one, but is limited to a single context. It is + often used with a shared read-only ObjectContext. </p><p>To take advantage of query result caching, the first step is to mark your queries + appropriately. Here is an example for ObjectSelect query. Other types of queries + have similar + API:</p><pre class="programlisting">ObjectSelect.query(Artist.class).localCache("artists");</pre><p>This tells Cayenne that the query created here would like to use local cache of + the context it is executed against. A vararg parameter to <code class="code">localCache()</code> + (or <code class="code">sharedCache()</code>) method contains so called "cache groups". Those are + arbitrary names that allow to categorize queries for the purpose of setting cache + policies or explicit invalidation of the cache. More on that below.</p><p>The above API is enough for the caching to work, but by default your cache is an + unmanaged LRU map. You can't control its size, expiration policies, etc. For the + managed cache, you will need to explicitly use one of the more advanced cache + providers. One such provider available in Cayenne is a provider for <a class="link" href="http://www.ehcache.org/" target="_top">EhCache</a>. It can be enabled on + ServerRuntime startup in a custom + Module:</p><pre class="programlisting">ServerRuntimeBuilder + .builder() + .addModule((binder) -> + binder.bind(QueryCache.class).to(EhCacheQueryCache.class) + ) + .build();</pre><p>By default EhCache reads a file called "ehcache.xml" located on classpath. You can + put your cache configuration in that file. + E.g.:</p><pre class="programlisting"><ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false" + monitoring="off" dynamicConfig="false"> + + <defaultCache maxEntriesLocalHeap="1000" eternal="false" + overflowToDisk="false" timeToIdleSeconds="3600" timeToLiveSeconds="3600"> + </defaultCache> + + <cache name="artists" timeToLiveSeconds="20" maxEntriesLocalHeap="100" /> +</ehcache></pre><p>The example shows how to configure default cache settings ("defaultCache") as well + as settings for a named cache group ("artists"). For many other things you can put + in "ehcache.xml" refer to EhCache docs.</p><p>Often "passive" cache expiration policies similar to shown above are not + sufficient, and the users want real-time cache invalidation when the data changes. + So in addition to those policies, the app can invalidate individual cache groups + explicitly with + <code class="code">RefreshQuery</code>:</p><pre class="programlisting">RefreshQuery refresh = new RefreshQuery("artist"); +context.performGenericQuery(refresh);</pre><p>The above can be used e.g. to build UI for manual cache invalidation. It is also + possible to automate cache refresh when certain entities are committed. This + requires including <code class="code">cayenne-lifecycle.jar</code> deoendency. From that library + you will need two things: <code class="code">@CacheGroups</code> annotation to mark entities that + generate cache invalidation events and <code class="code">CacheInvalidationFilter</code> that + catches the updates to the annotated objects and generates appropriate invalidation + events:</p><pre class="programlisting">// configure filter on startup +ServerRuntimeBuilder + .builder() + .addModule((binder) -> + binder.bindList(Constants.SERVER_DOMAIN_FILTERS_LIST).add(CacheInvalidationFilter.class) + ) + .build();</pre><p>Now you can associate entities with cache groups, so that commits to those + entities would atomatically invalidate the + groups:</p><pre class="programlisting">@CacheGroups("artists") +public class Artist extends _Artist { +}</pre><p>Finally you may cluster cache group events. They are very small and can be + efficiently sent over the wire to other JVMs running Cayenne. An example of Cayenne + setup with event clustering is <a class="link" href="https://github.com/andrus/wowodc13/tree/master/services/src/main/java/demo/services/cayenne" target="_top">available on GitHub</a>.</p></div></div><div class="section" title="Turning off Synchronization of ObjectContexts"><div class="titlepage"><div><div><h2 class="title"><a name="turning-off-synchronization-of-objectcontexts"></a>Turning off Synchronization of ObjectContexts</h2></div></div></div><p>By default when a single ObjectContext commits its changes, all other contexts in the same runtime receive an event that contains all the committed changes. This allows them to update their cached object state to match the latest committed data. There are however many problems with this ostensibly helpful feature. In short - it works well in