You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2012/12/26 20:20:16 UTC
svn commit: r1425994 [1/5] - in /cayenne/site/cms/trunk/content/docs/3.1:
cayenne-guide/ cayenne-guide/css/ tutorial/ tutorial/css/
Author: aadamchik
Date: Wed Dec 26 19:20:15 2012
New Revision: 1425994
URL: http://svn.apache.org/viewvc?rev=1425994&view=rev
Log:
updating the docs formatted per CAY-1733
Added:
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/css/highlight.css
cayenne/site/cms/trunk/content/docs/3.1/tutorial/css/highlight.css
Modified:
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/cayenne-guide-part2.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/cayennemodeler-application.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/client-configuration-properties.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/css/cayenne-doc.css
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/customizing-cayenne-runtime.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/expressions-bnf.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/expressions.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/including-cayenne-in-project.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/index.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/orderings.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/performance-tuning.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/persistent-objects-objectcontext.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/queries.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/rop-deployment.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/server-configuration-properties.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/setup.html
cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/starting-cayenne.html
cayenne/site/cms/trunk/content/docs/3.1/tutorial/ch04.html
cayenne/site/cms/trunk/content/docs/3.1/tutorial/ch05.html
cayenne/site/cms/trunk/content/docs/3.1/tutorial/ch06.html
cayenne/site/cms/trunk/content/docs/3.1/tutorial/ch07.html
cayenne/site/cms/trunk/content/docs/3.1/tutorial/ch08.html
cayenne/site/cms/trunk/content/docs/3.1/tutorial/ch09.html
cayenne/site/cms/trunk/content/docs/3.1/tutorial/css/cayenne-doc.css
Modified: cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/cayenne-guide-part2.html
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/cayenne-guide-part2.html?rev=1425994&r1=1425993&r2=1425994&view=diff
==============================================================================
--- cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/cayenne-guide-part2.html (original)
+++ cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/cayenne-guide-part2.html Wed Dec 26 19:20:15 2012
@@ -1,3 +1,3 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Part II. Cayenne Framework</title><link rel="stylesheet" type="text/css" href="css/cayenne-doc.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><link rel="home" href="index.html" title="Cayenne Guide"><link rel="up" href="index.html" title="Cayenne Guide"><link rel="prev" href="cayennemodeler-application.html" title="Chapter 3. CayenneModeler Application"><link rel="next" href="including-cayenne-in-project.html" title="Chapter 4. Including Cayenne in a Project"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part II. Cayenne Framework</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></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#startin
g-serverruntime">Starting and Stopping ServerRuntime</a></span></dt><dt><span class="section"><a href="starting-cayenne.html#d0e914">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="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-objectcontext.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#express
ions-in-memory">Evaluating Expressions in Memory</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">SQLTemplateQuery</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 Lifecyc
le Events</a></span></dt><dt><span class="section"><a href="lifecycle-events.html#lifecycle-callbacks-listeners">Lifecycle Callbacks and Listeners</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#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-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></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. CayenneM
odeler 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
+ <title>Part II. Cayenne Framework</title><link rel="stylesheet" type="text/css" href="css/cayenne-doc.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><link rel="home" href="index.html" title="Cayenne Guide"><link rel="up" href="index.html" title="Cayenne Guide"><link rel="prev" href="cayennemodeler-application.html" title="Chapter 3. CayenneModeler Application"><link rel="next" href="including-cayenne-in-project.html" title="Chapter 4. Including Cayenne in a Project"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part II. Cayenne Framework</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></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#startin
g-serverruntime">Starting and Stopping ServerRuntime</a></span></dt><dt><span class="section"><a href="starting-cayenne.html#d0e919">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="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-objectcontext.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#express
ions-in-memory">Evaluating Expressions in Memory</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">SQLTemplateQuery</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 Lifecyc
le Events</a></span></dt><dt><span class="section"><a href="lifecycle-events.html#lifecycle-callbacks-listeners">Lifecycle Callbacks and Listeners</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#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-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></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. CayenneM
odeler 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/3.1/cayenne-guide/cayennemodeler-application.html
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/cayennemodeler-application.html?rev=1425994&r1=1425993&r2=1425994&view=diff
==============================================================================
--- cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/cayennemodeler-application.html (original)
+++ cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/cayennemodeler-application.html Wed Dec 26 19:20:15 2012
@@ -1,13 +1,13 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 3. CayenneModeler Application</title><link rel="stylesheet" type="text/css" href="css/cayenne-doc.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><link rel="home" href="index.html" title="Cayenne Guide"><link rel="up" href="cayenne-guide-part1.html" title="Part I. Object Relational Mapping with Cayenne"><link rel="prev" href="cayenne-mapping-structure.html" title="Chapter 2. Cayenne Mapping Structure"><link rel="next" href="cayenne-guide-part2.html" title="Part II. Cayenne Framework"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. CayenneModeler Application</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="cayenne-mapping-structure.html">Prev</a> </td><th width="60%" align="center">Part I. Object Re
lational Mapping with Cayenne</th><td width="20%" align="right"> <a accesskey="n" href="cayenne-guide-part2.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 3. CayenneModeler Application"><div class="titlepage"><div><div><h2 class="title"><a name="cayennemodeler-application"></a>Chapter 3. CayenneModeler Application</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><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-application.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#modeling-pk-generation-strategy">Modeling Primary Key Generation Strategy</a></span></dt></dl></div><div class="section" title="Working with Mapping Projects"><div class="titlepage"><div><div><h2 class="title"><a name="working-with-mapping-projects"></a>Working with Mapping Projects</h2></div></div></div></div><div class="section" title="Reverse Engineering Database"><div class="titlepage"><div><div><h2 class="title"><a name="reverse-engineering-database"></a>Reverse Engineering Database</h2></div></div></div></div><div c
lass="section" title="Generating Database Schema"><div class="titlepage"><div><div><h2 class="title"><a name="generating-database-schema"></a>Generating Database Schema</h2></div></div></div></div><div class="section" title="Migrations"><div class="titlepage"><div><div><h2 class="title"><a name="migrations"></a>Migrations</h2></div></div></div></div><div class="section" title="Generating Java Classes"><div class="titlepage"><div><div><h2 class="title"><a name="generating-java-classes"></a>Generating Java Classes</h2></div></div></div></div><div class="section" title="Modeling Inheritance"><div class="titlepage"><div><div><h2 class="title"><a name="modeling-inheritance"></a>Modeling Inheritance</h2></div></div></div></div><div class="section" title="Modeling Generic Persistent Classes"><div class="titlepage"><div><div><h2 class="title"><a name="modeling-generic-persistence-classes"></a>Modeling Generic Persistent Classes</h2></div></div></div><p>Normally each ObjEntity is map
ped to a specific Java class (such as Artist or
- Painting) that explicitly declare all entity properties as pairs of getters and setters.
- However Cayenne allows to map a completly generic class to any number of entities. The
- only expectation is that a generic class implements
- <span class="emphasis"><em>org.apache.cayenne.DataObject</em></span>. So an ideal candidate for a
- generic class is CayenneDataObject, or some custom subclass of CayenneDataObject.</p><p>If you don't enter anything for Java Class of an ObjEntity, Cayenne assumes generic
- mapping and uses the following implicit rules to determine a class of a generic object.
- If DataMap "Custom Superclass" is set, runtime uses this class to instantiate new
- objects. If not, org.apache.cayenne.CayenneDataObject is used.</p><p>Class generation procedures (either done in the Modeler or with Ant or Maven) would
- skip entities that are mapped to CayenneDataObject explicitly or have no class
- mapping.</p></div><div class="section" title="Modeling Primary Key Generation Strategy"><div class="titlepage"><div><div><h2 class="title"><a name="modeling-pk-generation-strategy"></a>Modeling Primary Key Generation Strategy</h2></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="cayenne-mapping-structure.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="cayenne-guide-part1.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="cayenne-guide-part2.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Cayenne Mapping Structure </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Part II. Cayenne Framework</td></tr></table></div></body></html>
\ No newline at end of file
+ Painting) that explicitly declare all entity properties as pairs of getters and setters.
+ However Cayenne allows to map a completly generic class to any number of entities. The
+ only expectation is that a generic class implements
+ <span class="emphasis"><em>org.apache.cayenne.DataObject</em></span>. So an ideal candidate for a
+ generic class is CayenneDataObject, or some custom subclass of CayenneDataObject.</p><p>If you don't enter anything for Java Class of an ObjEntity, Cayenne assumes generic
+ mapping and uses the following implicit rules to determine a class of a generic object.
+ If DataMap "Custom Superclass" is set, runtime uses this class to instantiate new
+ objects. If not, org.apache.cayenne.CayenneDataObject is used.</p><p>Class generation procedures (either done in the Modeler or with Ant or Maven) would
+ skip entities that are mapped to CayenneDataObject explicitly or have no class
+ mapping.</p></div><div class="section" title="Modeling Primary Key Generation Strategy"><div class="titlepage"><div><div><h2 class="title"><a name="modeling-pk-generation-strategy"></a>Modeling Primary Key Generation Strategy</h2></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="cayenne-mapping-structure.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="cayenne-guide-part1.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="cayenne-guide-part2.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Cayenne Mapping Structure </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Part II. Cayenne Framework</td></tr></table></div></body></html>
\ No newline at end of file
Modified: cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/client-configuration-properties.html
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/client-configuration-properties.html?rev=1425994&r1=1425993&r2=1425994&view=diff
==============================================================================
--- cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/client-configuration-properties.html (original)
+++ cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/client-configuration-properties.html Wed Dec 26 19:20:15 2012
@@ -1,47 +1,47 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Appendix B. Service Collections</title><link rel="stylesheet" type="text/css" href="css/cayenne-doc.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><link rel="home" href="index.html" title="Cayenne Guide"><link rel="up" href="index.html" title="Cayenne Guide"><link rel="prev" href="server-configuration-properties.html" title="Appendix A. Configuration Properties"><link rel="next" href="expressions-bnf.html" title="Appendix C. Expressions BNF"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix B. Service Collections</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="server-configuration-properties.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="expressions-bnf.h
tml">Next</a></td></tr></table><hr></div><div class="appendix" title="Appendix B. Service Collections"><div class="titlepage"><div><div><h2 class="title"><a name="client-configuration-properties"></a>Appendix B. Service Collections</h2></div></div></div><p>Note that the collection keys below are
- defined as constants in <code class="code">org.apache.cayenne.configuration.Constants</code>
- interface.</p><p>
- </p><table frame="void" id="d0e2056"><caption>Table B.1. Service Collection Keys Present in ServerRuntime and/or ClientRuntime</caption><col width="100%"><tbody><tr>
- <td><code class="code">cayenne.properties</code> - Map<String,String> of properties used by built-in
- Cayenne services. The keys in this map are the property names from the table
- in Appendix A. Separate copies of this map exist on the server and ROP
- client.</td>
- </tr><tr>
- <td><code class="code">cayenne.server.adapter_detectors</code> - List<DbAdapterDetector> that contains
- objects that can discover the type of current database and install the
- correct DbAdapter in runtime.</td>
- </tr><tr>
- <td><code class="code">cayenne.server.domain_filters</code> - List<DataChannelFilter> storing DataDomain
- filters.</td>
- </tr><tr>
- <td><code class="code">cayenne.server.project_locations</code> - List<String> storing
- locations of the one of more project configuration files.</td>
- </tr><tr>
- <td><code class="code">cayenne.server.default_types</code> - List<ExtendedType> storing
- default adapter-agnostic ExtendedTypes. Default ExtendedTypes can be
- overridden / extended by DB-specific DbAdapters as well as by user-provided
- types configured in another colltecion (see
- "cayenne.server.user_types").</td>
- </tr><tr>
- <td><code class="code">cayenne.server.user_types</code> - List<ExtendedType> storing a
- user-provided ExtendedTypes. This collection will be merged into a full list
- of ExtendedTypes and would override any ExtendedTypes defined in a default
- list, or by a DbAdapter.</td>
- </tr><tr>
- <td><code class="code">cayenne.server.type_factories</code> - List<ExtendedTypeFactory>
- storing default and user-provided ExtendedTypeFactories. ExtendedTypeFactory
- allows to define ExtendedTypes dynamically for the whole group of Java
- classes. E.g. Cayenne supplies a factory to map all Enums regardless of
- their type.</td>
- </tr><tr>
- <td><code class="code">cayenne.server.rop_event_bridge_properties</code> - Map<String,
- String> storing event bridge properties passed to the ROP client on
- bootstrap. This means that the map is configured by server DI, and passed to
- the client via the wire. The properties in this map are specific to
- EventBridgeFactory implementation (e.g JMS or XMPP connection prameters).
- One common property is "cayenne.server.rop_event_bridge_factory" that
- defines the type of the factory.</td>
- </tr></tbody></table><p>
- </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="server-configuration-properties.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="expressions-bnf.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix A. Configuration Properties </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix C. Expressions BNF</td></tr></table></div></body></html>
\ No newline at end of file
+ defined as constants in <code class="code">org.apache.cayenne.configuration.Constants</code>
+ interface.</p><p>
+ </p><table frame="none" id="d0e2065"><caption>Table B.1. Service Collection Keys Present in ServerRuntime and/or ClientRuntime</caption><col width="100%"><tbody><tr>
+ <td><code class="code">cayenne.properties</code> - Map<String,String> of properties used by built-in
+ Cayenne services. The keys in this map are the property names from the table
+ in Appendix A. Separate copies of this map exist on the server and ROP
+ client.</td>
+ </tr><tr>
+ <td><code class="code">cayenne.server.adapter_detectors</code> - List<DbAdapterDetector> that contains
+ objects that can discover the type of current database and install the
+ correct DbAdapter in runtime.</td>
+ </tr><tr>
+ <td><code class="code">cayenne.server.domain_filters</code> - List<DataChannelFilter> storing DataDomain
+ filters.</td>
+ </tr><tr>
+ <td><code class="code">cayenne.server.project_locations</code> - List<String> storing
+ locations of the one of more project configuration files.</td>
+ </tr><tr>
+ <td><code class="code">cayenne.server.default_types</code> - List<ExtendedType> storing
+ default adapter-agnostic ExtendedTypes. Default ExtendedTypes can be
+ overridden / extended by DB-specific DbAdapters as well as by user-provided
+ types configured in another colltecion (see
+ "cayenne.server.user_types").</td>
+ </tr><tr>
+ <td><code class="code">cayenne.server.user_types</code> - List<ExtendedType> storing a
+ user-provided ExtendedTypes. This collection will be merged into a full list
+ of ExtendedTypes and would override any ExtendedTypes defined in a default
+ list, or by a DbAdapter.</td>
+ </tr><tr>
+ <td><code class="code">cayenne.server.type_factories</code> - List<ExtendedTypeFactory>
+ storing default and user-provided ExtendedTypeFactories. ExtendedTypeFactory
+ allows to define ExtendedTypes dynamically for the whole group of Java
+ classes. E.g. Cayenne supplies a factory to map all Enums regardless of
+ their type.</td>
+ </tr><tr>
+ <td><code class="code">cayenne.server.rop_event_bridge_properties</code> - Map<String,
+ String> storing event bridge properties passed to the ROP client on
+ bootstrap. This means that the map is configured by server DI, and passed to
+ the client via the wire. The properties in this map are specific to
+ EventBridgeFactory implementation (e.g JMS or XMPP connection prameters).
+ One common property is "cayenne.server.rop_event_bridge_factory" that
+ defines the type of the factory.</td>
+ </tr></tbody></table><p>
+ </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="server-configuration-properties.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="expressions-bnf.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix A. Configuration Properties </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix C. Expressions BNF</td></tr></table></div></body></html>
\ No newline at end of file
Modified: cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/css/cayenne-doc.css
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/css/cayenne-doc.css?rev=1425994&r1=1425993&r2=1425994&view=diff
==============================================================================
--- cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/css/cayenne-doc.css (original)
+++ cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/css/cayenne-doc.css Wed Dec 26 19:20:15 2012
@@ -0,0 +1,134 @@
+@IMPORT url("highlight.css");
+
+html {
+ padding: 0pt;
+ margin: 0pt;
+}
+
+body, td {
+ margin-left: 10%;
+ margin-right: 10%;
+ font-family: "Lucida Grande","Trebuchet MS",Verdana,sans-serif;
+ font-size: small;
+}
+
+div {
+ margin: 0pt;
+}
+
+p {
+ text-align: justify;
+}
+
+hr {
+ border: 1px solid gray;
+ background: gray;
+}
+
+h1, h2, h3, h4 {
+ font-family: "Trebuchet MS","Lucida Grande",Verdana,sans-serif;
+ font-weight: normal;
+ line-height: normal;
+ margin: 1em 0 0.5em;
+}
+
+h2 {
+ color: #660000;
+ font-size: 170%;
+ padding: 0;
+}
+
+h3 {
+ border-bottom: 1px solid #EAEAEA;
+ color: #CC4400;
+ font-size: 135%;
+ padding-bottom: 3px;
+}
+
+h4 {
+ color: #AAAA99;
+ font-size: 130%;
+}
+
+pre {
+ line-height: 1.0;
+ color: black;
+
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+}
+
+pre.programlisting {
+ font-size: 10pt;
+ padding: 7pt 3pt;
+ border: 1pt solid black;
+ background: #F9F9F6;
+ clear: both;
+}
+
+div.table {
+ margin: 1em;
+ padding: 0.5em;
+ text-align: center;
+}
+
+table[frame=void] {
+ display: table;
+ width: 100%;
+ border: 1px black solid;
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+table[frame=void] td {
+ padding-left: 7px;
+ padding-right: 7px;
+ border: 1px black solid;
+}
+
+table[frame=void] th {
+ padding-left: 7px;
+ padding-right: 7px;
+ border: 1px black solid;
+}
+
+.sidebar {
+ float: right;
+ margin: 10px 0 10px 30px;
+ padding: 10px 20px 20px 20px;
+ width: 33%;
+ border: 1px solid black;
+ background-color: #F4F4F4;
+ font-size: 14px;
+}
+
+.code {
+ font-family: Courier New,monospace;
+}
+
+.mediaobject {
+ padding-top: 30px;
+ padding-bottom: 30px;
+}
+
+.legalnotice {
+ font-size: 12px;
+ font-style: italic;
+}
+
+p.releaseinfo {
+ font-size: 100%;
+ font-weight: bold;
+ padding-top: 10px;
+}
+
+p.pubdate {
+ font-size: 120%;
+ font-weight: bold;
+}
+
+span.productname {
+ font-size: 200%;
+ font-weight: bold;
+}
\ No newline at end of file
Added: cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/css/highlight.css
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/css/highlight.css?rev=1425994&view=auto
==============================================================================
--- cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/css/highlight.css (added)
+++ cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/css/highlight.css Wed Dec 26 19:20:15 2012
@@ -0,0 +1,35 @@
+/*
+ code highlight CSS resemblign the Eclipse IDE default color schema
+ @author Costin Leau
+*/
+
+.hl-keyword {
+ color: #7F0055;
+ font-weight: bold;
+}
+
+.hl-comment {
+ color: #3F5F5F;
+ font-style: italic;
+}
+
+.hl-multiline-comment {
+ color: #3F5FBF;
+ font-style: italic;
+}
+
+.hl-tag {
+ color: #3F7F7F;
+}
+
+.hl-attribute {
+ color: #7F007F;
+}
+
+.hl-value {
+ color: #2A00FF;
+}
+
+.hl-string {
+ color: #2A00FF !important;
+}
\ No newline at end of file
Modified: cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/customizing-cayenne-runtime.html
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/customizing-cayenne-runtime.html?rev=1425994&r1=1425993&r2=1425994&view=diff
==============================================================================
--- cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/customizing-cayenne-runtime.html (original)
+++ cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/customizing-cayenne-runtime.html Wed Dec 26 19:20:15 2012
@@ -1,189 +1,189 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 12. Customizing Cayenne Runtime</title><link rel="stylesheet" type="text/css" href="css/cayenne-doc.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><link rel="home" href="index.html" title="Cayenne Guide"><link rel="up" href="cayenne-guide-part2.html" title="Part II. Cayenne Framework"><link rel="prev" href="performance-tuning.html" title="Chapter 11. Performance Tuning"><link rel="next" href="cayenne-guide-part3.html" title="Part III. Cayenne Framework - Remote Object Persistence"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 12. Customizing Cayenne Runtime</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="performance-tuning.html">Prev</a> </td><th width="60%" align="center">Part II. Cayenne Framewo
rk</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="depdende
ncy-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
- distinguish from all other objects that are not configured in the container and are not
- managed. DI container is responsible for service instantiation, injecting correct
- dependencies, maintaining service instances scope, and dispatching scope events to
- services. </p><p>The services are configured in special Java classes called "modules". Each module
- defines binding of service interfaces to implementation instances, implementation types
- or providers of implementation instances. There are no XML configuration files, and all
- the bindings are type-safe. The container supports injection into instance variables and
- constructor parameters based on the <code class="code">@Inject</code> annotation. This mechanism is
- very close to Google Guice.</p><p>The discussion later in this chapter demonstrates a standalone DI container. But keep in
- mind that Cayenne already has a built-in Injector, and a set of default modules. A
- Cayenne user would normally only use the API below to write custom extension modules
- that will be loaded in that existing container when creating ServerRuntime. See
- "Starting and Stopping ServerRuntime" chapter for an example of passing an extension
- module to Cayenne.</p><p>Cayenne DI probably has ~80% of the features expected in a DI container and has no
- dependency on the rest of Cayenne, so in theory can be used as an application-wide DI
- engine. But it's primary purpose is still to serve Cayenne. Hence there are no plans to
- expand it beyond Cayenne needs. It is an ideal "embedded" DI that does not interfere
- with Spring, Guice or any other such framework present elsewhere in the
- application.</p><div class="section" title="DI Bindings API"><div class="titlepage"><div><div><h3 class="title"><a name="di-bindings-api"></a>DI Bindings API</h3></div></div></div><p>To have a working DI container, we need three things: service interfaces and
- classes, a module that describes service bindings, a container that loads the
- module, and resolves the depedencies. Let's start with service interfaces and
- classes:</p><pre class="programlisting">public interface Service1 {
- public String getString();
-}</pre><pre class="programlisting">public interface Service2 {
- public int getInt();
+ 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
+ distinguish from all other objects that are not configured in the container and are not
+ managed. DI container is responsible for service instantiation, injecting correct
+ dependencies, maintaining service instances scope, and dispatching scope events to
+ services. </p><p>The services are configured in special Java classes called "modules". Each module
+ defines binding of service interfaces to implementation instances, implementation types
+ or providers of implementation instances. There are no XML configuration files, and all
+ the bindings are type-safe. The container supports injection into instance variables and
+ constructor parameters based on the <code class="code">@Inject</code> annotation. This mechanism is
+ very close to Google Guice.</p><p>The discussion later in this chapter demonstrates a standalone DI container. But keep in
+ mind that Cayenne already has a built-in Injector, and a set of default modules. A
+ Cayenne user would normally only use the API below to write custom extension modules
+ that will be loaded in that existing container when creating ServerRuntime. See
+ "Starting and Stopping ServerRuntime" chapter for an example of passing an extension
+ module to Cayenne.</p><p>Cayenne DI probably has ~80% of the features expected in a DI container and has no
+ dependency on the rest of Cayenne, so in theory can be used as an application-wide DI
+ engine. But it's primary purpose is still to serve Cayenne. Hence there are no plans to
+ expand it beyond Cayenne needs. It is an ideal "embedded" DI that does not interfere
+ with Spring, Guice or any other such framework present elsewhere in the
+ application.</p><div class="section" title="DI Bindings API"><div class="titlepage"><div><div><h3 class="title"><a name="di-bindings-api"></a>DI Bindings API</h3></div></div></div><p>To have a working DI container, we need three things: service interfaces and
+ classes, a module that describes service bindings, a container that loads the
+ module, and resolves the depedencies. Let's start with service interfaces and
+ classes:</p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">interface</span> Service1 {
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> String getString();
+}</pre><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">interface</span> Service2 {
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> getInt();
}</pre><p>A service implementation using instance variable
- injection:</p><pre class="programlisting">public class Service1Impl implements Service1 {
- @Inject
- private Service2 service2;
-
- public String getString() {
- return service2.getInt() + "_Service1Impl";
- }
+ injection:</p><pre class="programlisting"><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> Service1Impl <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">implements</span> Service1 {
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Inject</span>
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">private</span> Service2 service2;
+
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> String getString() {
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">return</span> service2.getInt() + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"_Service1Impl"</span>;
+ }
}</pre><p>Same
- thing, but using constructor
- injection:</p><pre class="programlisting">public class Service1Impl implements Service1 {
+ thing, but using constructor
+ injection:</p><pre class="programlisting"><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> Service1Impl <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">implements</span> Service1 {
- private Service2 service2;
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">private</span> Service2 service2;
- public Service1Impl(@Inject Service2 service2) {
- this.service2 = service2;
- }
-
- public String getString() {
- return service2.getInt() + "_Service1Impl";
- }
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> Service1Impl(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Inject</span> Service2 service2) {
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">this</span>.service2 = service2;
+ }
+
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> String getString() {
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">return</span> service2.getInt() + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"_Service1Impl"</span>;
+ }
}
-</pre><pre class="programlisting">public class Service2Impl implements Service2 {
- private int i;
+</pre><pre class="programlisting"><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> Service2Impl <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">implements</span> Service2 {
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">private</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> i;
- public int getInt() {
- return i++;
- }
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> getInt() {
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">return</span> i++;
+ }
}</pre><p>Now let's create a module implementing
- <code class="code">org.apache.cayenne.tutorial.di.Module</code> interface that will contain
- DI configuration. A module binds service objects to keys that are reference. Binder
- provided by container implements fluent API to connect the key to implementation,
- and to configure various binding options (the options, such as scope, are
- demonstrated later in this chapter). The simplest form of a key is a Java Class
- object representing service interface. Here is a module that binds Service1 and
- Service2 to corresponding default implementations:</p><p>
- </p><pre class="programlisting">public class Module1 implements Module {
-
- public void configure(Binder binder) {
- binder.bind(Service1.class).to(Service1Impl.class);
- binder.bind(Service2.class).to(Service2Impl.class);
- }
+ <code class="code">org.apache.cayenne.tutorial.di.Module</code> interface that will contain
+ DI configuration. A module binds service objects to keys that are reference. Binder
+ provided by container implements fluent API to connect the key to implementation,
+ and to configure various binding options (the options, such as scope, are
+ demonstrated later in this chapter). The simplest form of a key is a Java Class
+ object representing service interface. Here is a module that binds Service1 and
+ Service2 to corresponding default implementations:</p><p>
+ </p><pre class="programlisting"><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> Module1 <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">implements</span> Module {
+
+ <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.bind(Service1.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).to(Service1Impl.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>);
+ binder.bind(Service2.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).to(Service2Impl.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>);
+ }
}</pre><p>
- </p><p>Once we have at least one module, we can create a DI container.
- <code class="code">org.apache.cayenne.di.Injector</code> is the container class in
- Cayenne:</p><pre class="programlisting">Injector injector = DIBootstrap.createInjector(new Module1());</pre><p>Now that we have created the container, we can obtain services from it and call
- their
- methods:</p><pre class="programlisting">Service1 s1 = injector.getInstance(Service1.class);
-for (int i = 0; i < 5; i++) {
- System.out.println("S1 String: " + s1.getString());
+ </p><p>Once we have at least one module, we can create a DI container.
+ <code class="code">org.apache.cayenne.di.Injector</code> is the container class in
+ Cayenne:</p><pre class="programlisting">Injector injector = DIBootstrap.createInjector(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> Module1());</pre><p>Now that we have created the container, we can obtain services from it and call
+ their
+ methods:</p><pre class="programlisting">Service1 s1 = injector.getInstance(Service1.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>);
+<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 < <span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">5</span>; i++) {
+ System.out.println(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"S1 String: "</span> + s1.getString());
}</pre><p>This outputs the following lines, demonstrating that s1 was Service1Impl and
- Service2 injected into it was
- Service2Impl:</p><pre class="programlisting">0_Service1Impl
-1_Service1Impl
-2_Service1Impl
-3_Service1Impl
-4_Service1Impl</pre><p>There are more flavors of bindings:
- </p><pre class="programlisting">// binding to instance - allowing user to create and configure instance
-// inside the module class
-binder.bind(Service2.class).toInstance(new Service2Impl());
-
-// binding to provider - delegating instance creation to a special
-// provider class
-binder.bind(Service1.class).toProvider(Service1Provider.class);
-
-// binding to provider instance
-binder.bind(Service1.class).toProviderInstance(new Service1Provider());
-
-// multiple bindings of the same type using Key
-// injection can reference the key name in annotation:
-// @Inject("i1")
-// private Service2 service2;
-binder.bind(Key.get(Service2.class, "i1")).to(Service2Impl.class);
-binder.bind(Key.get(Service2.class, "i2")).to(Service2Impl.class);</pre><p>Another types of confiuguration that can be bound in the container are lists and
- maps. They will be discussed in the following chapters. </p></div><div class="section" title="Service Lifecycle"><div class="titlepage"><div><div><h3 class="title"><a name="managing-services-lifecycle"></a>Service Lifecycle</h3></div></div></div><p>An important feature of the Cayenne DI container is instance <span class="italic">scope</span>. The default scope (implicitly used in all examples above) is
- "singleton", meaning that a binding would result in creation of only one service
- instance, that will be repeatedly returned from
- <code class="code">Injector.getInstance(..)</code>, as well as injected into classes that
- declare it as a dependency. </p><p>Singleton scope dispatches a "BeforeScopeEnd" event to interested services. This
- event occurs before the scope is shutdown, i.e. when
- <code class="code">Injector.shutdown()</code> is called. Note that the built-in Cayenne
- injector is shutdown behind the scenes when <code class="code">ServerRuntime.shutdown()</code>
- is invoked. Services may register as listeners for this event by annotating a
- no-argument method with <code class="code">@BeforeScopeEnd</code> annotation. Such method should
- be implemented if a service needs to clean up some resources, stop threads,
- etc.</p><p>Another useful scope is "no scope", meaning that every time a container is asked to provide
- a service instance for a given key, a new instance will be created and
- returned:</p><pre class="programlisting">binder.bind(Service2.class).to(Service2Impl.class).withoutScope();</pre><p>Users
- can also create their own scopes, e.g. a web application request scope or a session
- scope. Most often than not custom scopes can be created as instances of
- <code class="code">org.apache.cayenne.di.spi.DefaultScope</code> with startup and shutdown
- managed by the application (e.g. singleton scope is a DefaultScope managed by the
- Injector) . </p></div><div class="section" title="Overriding Services"><div class="titlepage"><div><div><h3 class="title"><a name="overriding-services"></a>Overriding Services</h3></div></div></div><p>Cayenne DI allows to override services already definied in the current module, or
- more commonly - some other module in the the same container. Actually there's no
- special API to override a service, you'd just bind the service key again with a new
- implementation or provider. The last binding for a key takes precedence. This means
- that the order of modules is important when configuring a container. The built-in
- Cayenne injector ensures that Cayenne standard modules are loaded first, followed by
- optional user extension modules. This way the application can override the standard
- services in Cayenne.</p></div></div><div class="section" title="Customization Strategies"><div class="titlepage"><div><div><h2 class="title"><a name="ways-to-customize-runtime"></a> Customization Strategies</h2></div></div></div><p>The previous section discussed how Cayenne DI works in general terms. Since Cayenne users
- will mostly be dealing with an existing Injector provided by ServerRuntime, it is
- important to understand how to build custom extensions to a preconfigured container. As
- shown in "Starting and Stopping ServerRuntime" chapter, custom extensions are done by
- writing an aplication DI module (or multiple modules) that configures service overrides.
- This section shows all the configuration possibilities in detail, including changing
- properties of the existing services, contributing services to standard service lists and
- maps, and overriding service implementations. All the code examples later in this
- section are assumed to be placed in an application module "configure" method:</p><pre class="programlisting">public class MyExtensionsModule implements Module {
- public void configure(Binder binder) {
- // customizations go here...
- }
-}</pre><pre class="programlisting">Module extensions = new MyExtensionsModule();
+ Service2 injected into it was
+ Service2Impl:</p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">0</span>_Service1Impl
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">1</span>_Service1Impl
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">2</span>_Service1Impl
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">3</span>_Service1Impl
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">4</span>_Service1Impl</pre><p>There are more flavors of bindings:
+ </p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// binding to instance - allowing user to create and configure instance</span>
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// inside the module class</span>
+binder.bind(Service2.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).toInstance(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> Service2Impl());
+
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// binding to provider - delegating instance creation to a special</span>
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// provider class</span>
+binder.bind(Service1.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).toProvider(Service1Provider.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>);
+
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// binding to provider instance</span>
+binder.bind(Service1.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).toProviderInstance(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> Service1Provider());
+
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// multiple bindings of the same type using Key</span>
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// injection can reference the key name in annotation:</span>
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// @Inject("i1")</span>
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// private Service2 service2;</span>
+binder.bind(Key.get(Service2.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"i1"</span>)).to(Service2Impl.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>);
+binder.bind(Key.get(Service2.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"i2"</span>)).to(Service2Impl.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>);</pre><p>Another types of confiuguration that can be bound in the container are lists and
+ maps. They will be discussed in the following chapters. </p></div><div class="section" title="Service Lifecycle"><div class="titlepage"><div><div><h3 class="title"><a name="managing-services-lifecycle"></a>Service Lifecycle</h3></div></div></div><p>An important feature of the Cayenne DI container is instance <span class="italic">scope</span>. The default scope (implicitly used in all examples above) is
+ "singleton", meaning that a binding would result in creation of only one service
+ instance, that will be repeatedly returned from
+ <code class="code">Injector.getInstance(..)</code>, as well as injected into classes that
+ declare it as a dependency. </p><p>Singleton scope dispatches a "BeforeScopeEnd" event to interested services. This
+ event occurs before the scope is shutdown, i.e. when
+ <code class="code">Injector.shutdown()</code> is called. Note that the built-in Cayenne
+ injector is shutdown behind the scenes when <code class="code">ServerRuntime.shutdown()</code>
+ is invoked. Services may register as listeners for this event by annotating a
+ no-argument method with <code class="code">@BeforeScopeEnd</code> annotation. Such method should
+ be implemented if a service needs to clean up some resources, stop threads,
+ etc.</p><p>Another useful scope is "no scope", meaning that every time a container is asked to provide
+ a service instance for a given key, a new instance will be created and
+ returned:</p><pre class="programlisting">binder.bind(Service2.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).to(Service2Impl.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).withoutScope();</pre><p>Users
+ can also create their own scopes, e.g. a web application request scope or a session
+ scope. Most often than not custom scopes can be created as instances of
+ <code class="code">org.apache.cayenne.di.spi.DefaultScope</code> with startup and shutdown
+ managed by the application (e.g. singleton scope is a DefaultScope managed by the
+ Injector) . </p></div><div class="section" title="Overriding Services"><div class="titlepage"><div><div><h3 class="title"><a name="overriding-services"></a>Overriding Services</h3></div></div></div><p>Cayenne DI allows to override services already definied in the current module, or
+ more commonly - some other module in the the same container. Actually there's no
+ special API to override a service, you'd just bind the service key again with a new
+ implementation or provider. The last binding for a key takes precedence. This means
+ that the order of modules is important when configuring a container. The built-in
+ Cayenne injector ensures that Cayenne standard modules are loaded first, followed by
+ optional user extension modules. This way the application can override the standard
+ services in Cayenne.</p></div></div><div class="section" title="Customization Strategies"><div class="titlepage"><div><div><h2 class="title"><a name="ways-to-customize-runtime"></a> Customization Strategies</h2></div></div></div><p>The previous section discussed how Cayenne DI works in general terms. Since Cayenne users
+ will mostly be dealing with an existing Injector provided by ServerRuntime, it is
+ important to understand how to build custom extensions to a preconfigured container. As
+ shown in "Starting and Stopping ServerRuntime" chapter, custom extensions are done by
+ writing an aplication DI module (or multiple modules) that configures service overrides.
+ This section shows all the configuration possibilities in detail, including changing
+ properties of the existing services, contributing services to standard service lists and
+ maps, and overriding service implementations. All the code examples later in this
+ section are assumed to be placed in an application module "configure" method:</p><pre class="programlisting">public class MyExtensionsModule implements Module {
+ public void configure(Binder binder) {
+ // customizations go here...
+ }
+}</pre><pre class="programlisting">Module extensions = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> MyExtensionsModule();
ServerRuntime runtime =
- new ServerRuntime("com/example/cayenne-mydomain.xml", extensions);</pre><div class="section" title="Changing Properties of Existing Services"><div class="titlepage"><div><div><h3 class="title"><a name="changing-properties-of-existing-services"></a>Changing Properties of Existing Services</h3></div></div></div><p>Many built-in Cayenne services change their behavior based on a value of some
- environment property. A user may change Cayenne behavior without even knowing which
- services are responsible for it, but setting a specific value of a known property.
- Supported property names are listed in "Appendix A".</p><p>There are two ways to set service properties. The most obvious one is to pass it
- to the JVM with -D flag on startup.
- E.g.</p><pre class="programlisting">java -Dorg.apache.cayenne.sync_contexts=false ...</pre><p>A second one is to contribute a property to
- <code class="code">org.apache.cayenne.configuration.DefaultRuntimeProperties.properties
- </code>map (see the next section on how to do that). This map contains the default
- property values and can accept application-specific values, overrding the defaults. </p><p>Note that if a property value is a name of a Java class, when this Java class is
- instantiated by Cayenne, the container performs injection of instance variables. So
- even the dynamically specified Java classes can use @Inject annotation to get a hold
- of other Cayenne services.</p><p>If the same property is specified both in the command line and in the properties
- map, the command-line value takes precedence. The map value will be ignored. This
- way Cayenne runtime can be reconfigured during deployment.</p></div><div class="section" title="Contributing to Service Collections"><div class="titlepage"><div><div><h3 class="title"><a name="contributing-to-service-lists-maps"></a>Contributing to Service Collections</h3></div></div></div><p>Cayenne can be extended by adding custom objects to named maps or lists bound in
- DI. We are calling these lists/maps "service collections". A service collection
- allows things like appending a custom strategy to a list of built-in strategies.
- E.g. an application that needs to install a custom DbAdapter for some database type
- may contribute an instance of custom DbAdapterDetector to a
- <code class="code">org.apache.cayenne.configuration.server.DefaultDbAdapterFactory.detectors</code>
- list:</p><pre class="programlisting">public class MyDbAdapterDetector implements DbAdapterDetector {
- public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
- // check if we support this database and retun custom adapter
- ...
- }
-}</pre><pre class="programlisting">// since build-in list for this key is a singleton, repeated
-// calls to 'bindList' will return the same instance
+ <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">"com/example/cayenne-mydomain.xml"</span>, extensions);</pre><div class="section" title="Changing Properties of Existing Services"><div class="titlepage"><div><div><h3 class="title"><a name="changing-properties-of-existing-services"></a>Changing Properties of Existing Services</h3></div></div></div><p>Many built-in Cayenne services change their behavior based on a value of some
+ environment property. A user may change Cayenne behavior without even knowing which
+ services are responsible for it, but setting a specific value of a known property.
+ Supported property names are listed in "Appendix A".</p><p>There are two ways to set service properties. The most obvious one is to pass it
+ to the JVM with -D flag on startup.
+ E.g.</p><pre class="programlisting">java -Dorg.apache.cayenne.sync_contexts=false ...</pre><p>A second one is to contribute a property to
+ <code class="code">org.apache.cayenne.configuration.DefaultRuntimeProperties.properties
+ </code>map (see the next section on how to do that). This map contains the default
+ property values and can accept application-specific values, overrding the defaults. </p><p>Note that if a property value is a name of a Java class, when this Java class is
+ instantiated by Cayenne, the container performs injection of instance variables. So
+ even the dynamically specified Java classes can use @Inject annotation to get a hold
+ of other Cayenne services.</p><p>If the same property is specified both in the command line and in the properties
+ map, the command-line value takes precedence. The map value will be ignored. This
+ way Cayenne runtime can be reconfigured during deployment.</p></div><div class="section" title="Contributing to Service Collections"><div class="titlepage"><div><div><h3 class="title"><a name="contributing-to-service-lists-maps"></a>Contributing to Service Collections</h3></div></div></div><p>Cayenne can be extended by adding custom objects to named maps or lists bound in
+ DI. We are calling these lists/maps "service collections". A service collection
+ allows things like appending a custom strategy to a list of built-in strategies.
+ E.g. an application that needs to install a custom DbAdapter for some database type
+ may contribute an instance of custom DbAdapterDetector to a
+ <code class="code">org.apache.cayenne.configuration.server.DefaultDbAdapterFactory.detectors</code>
+ list:</p><pre class="programlisting"><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> MyDbAdapterDetector <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">implements</span> DbAdapterDetector {
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> DbAdapter createAdapter(DatabaseMetaData md) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">throws</span> SQLException {
+ <span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// check if we support this database and retun custom adapter</span>
+ ...
+ }
+}</pre><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// since build-in list for this key is a singleton, repeated</span>
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// calls to 'bindList' will return the same instance </span>
binder.bindList(DefaultDbAdapterFactory.DETECTORS_LIST)
- .add(MyDbAdapterDetector.class);</pre><p>Maps are customized using a similar "<code class="code">bindMap</code>" method.</p><p>The names of built-in collections are listed in "Appendix B".</p></div><div class="section" title="Alternative Service Implementations"><div class="titlepage"><div><div><h3 class="title"><a name="alternative-service-implementations"></a>Alternative Service Implementations</h3></div></div></div><p>As mentioned above, custom modules are loaded by ServerRuntime after the built-in
- modules. So it is easy to redefine a built-in service in Cayenne by rebinding
- desired implementations or providers. To do that, first we need to know what those
- services to redefine are. While we describe some of them in the following sections,
- the best way to get a full list is to check the source code of the Cayenne version
- you are using and namely look in
- <code class="code">org.apache.cayenne.configuration.server.ServerModule</code> - the main
- built-in module in Cayenne. </p><p>Now an example of overriding <code class="code">QueryCache</code> service. The default
- 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.class).to(EhCacheQueryCache.class);</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
- 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" hr
ef="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
+ .add(MyDbAdapterDetector.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>);</pre><p>Maps are customized using a similar "<code class="code">bindMap</code>" method.</p><p>The names of built-in collections are listed in "Appendix B".</p></div><div class="section" title="Alternative Service Implementations"><div class="titlepage"><div><div><h3 class="title"><a name="alternative-service-implementations"></a>Alternative Service Implementations</h3></div></div></div><p>As mentioned above, custom modules are loaded by ServerRuntime after the built-in
+ modules. So it is easy to redefine a built-in service in Cayenne by rebinding
+ desired implementations or providers. To do that, first we need to know what those
+ services to redefine are. While we describe some of them in the following sections,
+ the best way to get a full list is to check the source code of the Cayenne version
+ you are using and namely look in
+ <code class="code">org.apache.cayenne.configuration.server.ServerModule</code> - the main
+ built-in module in Cayenne. </p><p>Now an example of overriding <code class="code">QueryCache</code> service. The default
+ 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
+ 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 acce
sskey="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
Modified: cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/expressions-bnf.html
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/expressions-bnf.html?rev=1425994&r1=1425993&r2=1425994&view=diff
==============================================================================
--- cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/expressions-bnf.html (original)
+++ cayenne/site/cms/trunk/content/docs/3.1/cayenne-guide/expressions-bnf.html Wed Dec 26 19:20:15 2012
@@ -56,8 +56,10 @@ TOKENS
* Integer or real Numeric literal, whose object value is stored in the token manager's
* "literalValue" field.
*/<DEFAULT> TOKEN : {
-<INT_LITERAL: ("0" (["0"-"7"])* | ["1"-"9"] (["0"-"9"])* | "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+) (["l","L","h","H"])?> : {
-| <FLOAT_LITERAL: <DEC_FLT> (<EXPONENT>)? (<FLT_SUFF>)? | <DEC_DIGITS> <EXPONENT> (<FLT_SUFF>)? | <DEC_DIGITS> <FLT_SUFF>> : {
+<INT_LITERAL: ("0" (["0"-"7"])* | ["1"-"9"] (["0"-"9"])* | "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+)
+ (["l","L","h","H"])?> : {
+| <FLOAT_LITERAL: <DEC_FLT> (<EXPONENT>)? (<FLT_SUFF>)? | <DEC_DIGITS> <EXPONENT> (<FLT_SUFF>)?
+| <DEC_DIGITS> <FLT_SUFF>> : {
| <#DEC_FLT: (["0"-"9"])+ "." (["0"-"9"])* | "." (["0"-"9"])+>
| <#DEC_DIGITS: (["0"-"9"])+>
| <#EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+>
@@ -65,14 +67,14 @@ TOKENS
}
NON-TERMINALS
- expression := orCondition <EOF>
- orCondition := andCondition ( "or" andCondition )*
- andCondition := notCondition ( "and" notCondition )*
- notCondition := ( "not" | "!" ) simpleCondition
- | simpleCondition
- simpleCondition := <TRUE>
- | <FALSE>
- | scalarConditionExpression
+ expression := orCondition <EOF>
+ orCondition := andCondition ( "or" andCondition )*
+ andCondition := notCondition ( "and" notCondition )*
+ notCondition := ( "not" | "!" ) simpleCondition
+ | simpleCondition
+ simpleCondition := <TRUE>
+ | <FALSE>
+ | scalarConditionExpression
( simpleNotCondition
| ( "=" | "==" ) scalarExpression
| ( "!=" | "<>" ) scalarExpression
@@ -84,39 +86,39 @@ NON-TERMINALS
| "in" ( namedParameter | "(" scalarCommaList ")" )
| "between" scalarExpression "and" scalarExpression
)?
- simpleNotCondition := ( "not" | "!" )
+ simpleNotCondition := ( "not" | "!" )
( "like" scalarExpression
| "likeIgnoreCase" scalarExpression
| "in" ( namedParameter | "(" scalarCommaList ")" )
| "between" scalarExpression "and" scalarExpression
)
- scalarCommaList := ( scalarConstExpression ( "," scalarConstExpression )* )
- scalarConditionExpression := scalarNumericExpression
- | <SINGLE_QUOTED_STRING>
- | <DOUBLE_QUOTED_STRING>
- | <NULL>
- scalarExpression := scalarConditionExpression
- | <TRUE>
- | <FALSE>
- scalarConstExpression := <SINGLE_QUOTED_STRING>
- | <DOUBLE_QUOTED_STRING>
- | namedParameter
- | <INT_LITERAL>
- | <FLOAT_LITERAL>
- | <TRUE>
- | <FALSE>
- scalarNumericExpression := multiplySubtractExp
+ scalarCommaList := ( scalarConstExpression ( "," scalarConstExpression )* )
+ scalarConditionExpression := scalarNumericExpression
+ | <SINGLE_QUOTED_STRING>
+ | <DOUBLE_QUOTED_STRING>
+ | <NULL>
+ scalarExpression := scalarConditionExpression
+ | <TRUE>
+ | <FALSE>
+ scalarConstExpression := <SINGLE_QUOTED_STRING>
+ | <DOUBLE_QUOTED_STRING>
+ | namedParameter
+ | <INT_LITERAL>
+ | <FLOAT_LITERAL>
+ | <TRUE>
+ | <FALSE>
+ scalarNumericExpression := multiplySubtractExp
( "+" multiplySubtractExp | "-" multiplySubtractExp )*
- multiplySubtractExp := numericTerm ( "*" numericTerm | "/" numericTerm )*
- numericTerm := ( "+" )? numericPrimary
- | "-" numericPrimary
- numericPrimary := "(" orCondition ")"
- | pathExpression
- | namedParameter
- | <INT_LITERAL>
- | <FLOAT_LITERAL>
- namedParameter := "$" <PROPERTY_PATH>
- pathExpression := ( <PROPERTY_PATH>
+ multiplySubtractExp := numericTerm ( "*" numericTerm | "/" numericTerm )*
+ numericTerm := ( "+" )? numericPrimary
+ | "-" numericPrimary
+ numericPrimary := "(" orCondition ")"
+ | pathExpression
+ | namedParameter
+ | <INT_LITERAL>
+ | <FLOAT_LITERAL>
+ namedParameter := "$" <PROPERTY_PATH>
+ pathExpression := ( <PROPERTY_PATH>
| "obj:" <PROPERTY_PATH>
| "db:" <PROPERTY_PATH>
| "enum:" <PROPERTY_PATH> )