db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject svn commit: r1432659 [7/12] - in /db/jdo/site: ./ src/ src/site/ src/site/resources/ src/site/resources/images/ src/site/resources/releases/ src/site/xdoc/ src/site/xdoc/guides/ src/site/xdoc/releases/
Date Sun, 13 Jan 2013 17:05:18 GMT
Added: db/jdo/site/src/site/resources/releases/jdo_2_1_2008-01-18.pdf
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/resources/releases/jdo_2_1_2008-01-18.pdf?rev=1432659&view=auto
==============================================================================
Files db/jdo/site/src/site/resources/releases/jdo_2_1_2008-01-18.pdf (added) and db/jdo/site/src/site/resources/releases/jdo_2_1_2008-01-18.pdf Sun Jan 13 17:05:15 2013 differ

Added: db/jdo/site/src/site/resources/releases/release-2.0-beta.cgi
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/resources/releases/release-2.0-beta.cgi?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/resources/releases/release-2.0-beta.cgi (added)
+++ db/jdo/site/src/site/resources/releases/release-2.0-beta.cgi Sun Jan 13 17:05:15 2013
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Copyright 2002-2004 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+# Wrapper script around mirrors.cgi script
+# (we must change to that directory in order for python to pick up the
+#  python includes correctly)
+# Copied from Stefan's http://www.apache.org/~bodewig/mirror.html
+cd /www/www.apache.org/dyn/mirrors 
+/www/www.apache.org/dyn/mirrors/mirrors.cgi $*

Propchange: db/jdo/site/src/site/resources/releases/release-2.0-beta.cgi
------------------------------------------------------------------------------
    svn:executable = *

Added: db/jdo/site/src/site/resources/releases/release-2.0-rc1.cgi
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/resources/releases/release-2.0-rc1.cgi?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/resources/releases/release-2.0-rc1.cgi (added)
+++ db/jdo/site/src/site/resources/releases/release-2.0-rc1.cgi Sun Jan 13 17:05:15 2013
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Copyright 2002-2004 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+# Wrapper script around mirrors.cgi script
+# (we must change to that directory in order for python to pick up the
+#  python includes correctly)
+# Copied from Stefan's http://www.apache.org/~bodewig/mirror.html
+cd /www/www.apache.org/dyn/mirrors 
+/www/www.apache.org/dyn/mirrors/mirrors.cgi $*

Propchange: db/jdo/site/src/site/resources/releases/release-2.0-rc1.cgi
------------------------------------------------------------------------------
    svn:executable = *

Added: db/jdo/site/src/site/resources/releases/release-2.0.cgi
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/resources/releases/release-2.0.cgi?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/resources/releases/release-2.0.cgi (added)
+++ db/jdo/site/src/site/resources/releases/release-2.0.cgi Sun Jan 13 17:05:15 2013
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Copyright 2002-2004 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+# Wrapper script around mirrors.cgi script
+# (we must change to that directory in order for python to pick up the
+#  python includes correctly)
+# Copied from Stefan's http://www.apache.org/~bodewig/mirror.html
+cd /www/www.apache.org/dyn/mirrors 
+/www/www.apache.org/dyn/mirrors/mirrors.cgi $*

Propchange: db/jdo/site/src/site/resources/releases/release-2.0.cgi
------------------------------------------------------------------------------
    svn:executable = *

Added: db/jdo/site/src/site/resources/releases/release-2.1.1.cgi
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/resources/releases/release-2.1.1.cgi?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/resources/releases/release-2.1.1.cgi (added)
+++ db/jdo/site/src/site/resources/releases/release-2.1.1.cgi Sun Jan 13 17:05:15 2013
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Copyright 2002-2004 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+# Wrapper script around mirrors.cgi script
+# (we must change to that directory in order for python to pick up the
+#  python includes correctly)
+# Copied from Stefan's http://www.apache.org/~bodewig/mirror.html
+cd /www/www.apache.org/dyn/mirrors 
+/www/www.apache.org/dyn/mirrors/mirrors.cgi $*

Propchange: db/jdo/site/src/site/resources/releases/release-2.1.1.cgi
------------------------------------------------------------------------------
    svn:executable = *

Added: db/jdo/site/src/site/resources/releases/release-2.1.cgi
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/resources/releases/release-2.1.cgi?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/resources/releases/release-2.1.cgi (added)
+++ db/jdo/site/src/site/resources/releases/release-2.1.cgi Sun Jan 13 17:05:15 2013
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Copyright 2002-2004 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+# Wrapper script around mirrors.cgi script
+# (we must change to that directory in order for python to pick up the
+#  python includes correctly)
+# Copied from Stefan's http://www.apache.org/~bodewig/mirror.html
+cd /www/www.apache.org/dyn/mirrors 
+/www/www.apache.org/dyn/mirrors/mirrors.cgi $*

Propchange: db/jdo/site/src/site/resources/releases/release-2.1.cgi
------------------------------------------------------------------------------
    svn:executable = *

Added: db/jdo/site/src/site/resources/releases/release-2.2.cgi
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/resources/releases/release-2.2.cgi?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/resources/releases/release-2.2.cgi (added)
+++ db/jdo/site/src/site/resources/releases/release-2.2.cgi Sun Jan 13 17:05:15 2013
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Copyright 2002-2004 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+# Wrapper script around mirrors.cgi script
+# (we must change to that directory in order for python to pick up the
+#  python includes correctly)
+# Copied from Stefan's http://www.apache.org/~bodewig/mirror.html
+cd /www/www.apache.org/dyn/mirrors 
+/www/www.apache.org/dyn/mirrors/mirrors.cgi $*

Propchange: db/jdo/site/src/site/resources/releases/release-2.2.cgi
------------------------------------------------------------------------------
    svn:executable = *

Added: db/jdo/site/src/site/resources/releases/release-2.3-ea.cgi
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/resources/releases/release-2.3-ea.cgi?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/resources/releases/release-2.3-ea.cgi (added)
+++ db/jdo/site/src/site/resources/releases/release-2.3-ea.cgi Sun Jan 13 17:05:15 2013
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Copyright 2002-2004 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+# Wrapper script around mirrors.cgi script
+# (we must change to that directory in order for python to pick up the
+#  python includes correctly)
+# Copied from Stefan's http://www.apache.org/~bodewig/mirror.html
+cd /www/www.apache.org/dyn/mirrors 
+/www/www.apache.org/dyn/mirrors/mirrors.cgi $*

Propchange: db/jdo/site/src/site/resources/releases/release-2.3-ea.cgi
------------------------------------------------------------------------------
    svn:executable = *

Added: db/jdo/site/src/site/resources/releases/release-3.0.1.cgi
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/resources/releases/release-3.0.1.cgi?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/resources/releases/release-3.0.1.cgi (added)
+++ db/jdo/site/src/site/resources/releases/release-3.0.1.cgi Sun Jan 13 17:05:15 2013
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Copyright 2002-2004 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+# Wrapper script around mirrors.cgi script
+# (we must change to that directory in order for python to pick up the
+#  python includes correctly)
+# Copied from Stefan's http://www.apache.org/~bodewig/mirror.html
+cd /www/www.apache.org/dyn/mirrors 
+/www/www.apache.org/dyn/mirrors/mirrors.cgi $*

Propchange: db/jdo/site/src/site/resources/releases/release-3.0.1.cgi
------------------------------------------------------------------------------
    svn:executable = *

Added: db/jdo/site/src/site/resources/releases/release-3.0.cgi
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/resources/releases/release-3.0.cgi?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/resources/releases/release-3.0.cgi (added)
+++ db/jdo/site/src/site/resources/releases/release-3.0.cgi Sun Jan 13 17:05:15 2013
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Copyright 2002-2004 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+# Wrapper script around mirrors.cgi script
+# (we must change to that directory in order for python to pick up the
+#  python includes correctly)
+# Copied from Stefan's http://www.apache.org/~bodewig/mirror.html
+cd /www/www.apache.org/dyn/mirrors 
+/www/www.apache.org/dyn/mirrors/mirrors.cgi $*

Propchange: db/jdo/site/src/site/resources/releases/release-3.0.cgi
------------------------------------------------------------------------------
    svn:executable = *

Added: db/jdo/site/src/site/site.xml
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/site.xml?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/site.xml (added)
+++ db/jdo/site/src/site/site.xml Sun Jan 13 17:05:15 2013
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project name="Maven">
+    <bannerLeft>
+        <name>Apache JDO</name>
+        <src>http://db.apache.org/jdo/images/JDOx150.gif</src>
+        <href>http://db.apache.org/jdo</href>
+    </bannerLeft>
+    <bannerRight>
+        <src>http://db.apache.org/jdo/images/jdo_text.gif</src>
+    </bannerRight>
+    <body>
+        <menu name="General">
+            <item name="Home" href="/index.html"/>
+            <item name="Why JDO?" href="/why_jdo.html"/>
+            <item name="JDO v JPA" href="/jdo_v_jpa.html"/>
+            <item name="JDO v JPA : API" href="/jdo_v_jpa_api.html"/>
+            <item name="JDO v JPA : ORM" href="/jdo_v_jpa_orm.html"/>
+            <item name="Downloads" href="/downloads.html"/>
+            <item name="License" href="http://www.apache.org/licenses/LICENSE-2.0"/>
+        </menu>
+
+        <menu name="JDO Implementation">
+            <item name="Specifications" href="/specifications.html"/>
+            <item name="TCK" href="/tck.html"/>
+        </menu>
+
+        <menu name="JDO Usage">
+            <item name="Implementations" href="/impls.html"/>
+            <item name="API Javadoc" href="/javadoc.html"/>
+            <item name="Types of Classes" href="/class_types.html"/>
+            <item name="Types of Fields" href="/field_types.html"/>
+                <item name="MetaData" href="/metadata.html" collapse="true">
+                <item name="jdo DTD/XSD" href="/jdo_dtd.html"/>
+                <item name="orm DTD/XSD" href="/orm_dtd.html"/>
+                <item name="jdoquery DTD/XSD" href="/jdoquery_dtd.html"/>
+                <item name="jdoconfig DTD/XSD" href="/jdoconfig_dtd.html"/>
+            </item>
+            <item name="Bytecode Enhancement" href="/enhancement.html"/>
+            <item name="JDOHelper" href="/jdohelper.html"/>
+            <item name="PersistenceManagerFactory" href="/pmf.html"/>
+            <item name="PersistenceManager" href="/pm.html"/>
+            <item name="Transactions" href="/transactions.html"/>
+            <item name="Attach-Detach" href="/attach_detach.html"/>
+            <item name="Fetch Groups" href="/fetchgroups.html"/>
+            <item name="Object States" href="/state_transition.html"/>
+            <item name="Object Retrieval" href="/object_retrieval.html"/>
+            <item name="JDOQL" href="/jdoql.html" collapse="false">
+                <item name="Result" href="/jdoql_result.html"/>
+                <item name="Methods" href="/jdoql_methods.html"/>
+                <item name="Quick Ref PDF" href="/jdoql_quickref.pdf"/>
+            </item>
+            <item name="Extents" href="/extents.html"/>
+                <item name="Guides" href="/guides.html" collapse="true">
+                <item name="Datastore Replication" href="/guides/replication.html"/>
+                <item name="JDO and Maven1" href="/guides/maven-jdo.html"/>
+            </item>
+            <item name="References" href="/references.html"/>
+            <item name="Exceptions" href="/exceptions.html"/>
+            <item name="Glossary" href="/glossary.html"/>
+        </menu>
+
+        <menu name="Articles">
+            <item name="JDO 3.0 Overview" href="/jdo_3_0_overview.html"/>
+        </menu>
+        
+        <menu name="Community">
+            <item name="Get Involved" href="/get-involved.html"/>
+            <item name="Project Team" href="/team-list.html"/>
+            <item name="Mailing Lists" href="/mail-lists.html"/>
+            <item name="FAQ" href="/faq.html"/>
+            <item name="Wiki" href="http://wiki.apache.org/jdo"/>
+        </menu>
+
+        <menu name="Development">
+            <item name="RoadMap / TODO" href="/roadmap.html"/>
+            <item name="Source Code" href="/svn.html"/>
+            <item name="Coding Standards" href="http://cwiki.apache.org/GMOxDEV/coding-standards.html"/>
+            <item name="Issue Tracking" href="/issuetracking.html"/>
+            <item name="Dependencies" href="/dependencies.html"/>
+        </menu>
+    </body>
+</project>

Added: db/jdo/site/src/site/xdoc/attach_detach.xml
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/xdoc/attach_detach.xml?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/xdoc/attach_detach.xml (added)
+++ db/jdo/site/src/site/xdoc/attach_detach.xml Sun Jan 13 17:05:15 2013
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+    <properties>
+        <title>Attach/Detach</title>
+    </properties>
+
+    <body>
+        <section name="JDO Attach/Detach">
+            <p>
+                JDO provides an interface to the persistence of objects. JDO 1.0 doesn't provide a way of taking 
+                an object that was just persisted and just work on it and update the persisted object later. 
+                The user has to copy the fields manually and copy them back to the persisted object later. 
+                JDO 2.0 introduces a new way of handling this situation, by <b>detaching</b> an object from the 
+                persistence graph, allowing it to be worked on in the users application. It can then be 
+                <b>attached</b> to the persistence graph later. 
+                Please refer to <a href="state_transition.html">Object Lifecycle</a> for where this fits in.
+                The first thing to do to use a class with this facility is to tag it as "detachable". 
+                This is done by adding the attribute
+            </p>
+            <source>&lt;class name="MyClass" detachable="true"&gt;</source>
+            <p>
+                This acts as an instruction to the <a href="enhancement.html">enhancement process</a> to add 
+                methods necessary to utilise the attach/detach process.
+            </p>
+
+            <p>
+                The following code fragment highlights how to use the attach/detach mechanism
+            </p>
+            <source>
+Product working_product=null;
+Transaction tx=pm.currentTransaction();
+try
+{
+    tx.begin();
+
+    Product prod=new Product(name,description,price);
+    pm.makePersistent(prod);
+
+    // Detach the product for use
+    working_product = (Product)pm.detachCopy(prod);
+
+    tx.commit();
+}
+catch (Exception e)
+{
+    // Handle the exception
+}
+finally
+{
+    if (tx.isActive())
+    {
+        tx.rollback();
+    }
+}
+
+// Work on the detached object in our application
+working_product.setPrice(new_price);
+
+...
+
+// Reattach the updated object
+tx = pm.currentTransaction();
+try
+{
+    tx.begin();
+
+    Product attached_product = pm.makePersistent(working_product);
+
+    tx.commit();
+}
+catch (Exception e)
+{
+    // Handle the exception
+}
+finally
+{
+    if (tx.isActive())
+    {
+        tx.rollback();
+    }
+}</source>
+            <p>
+                So we now don't need to do any manual copying of object fields just using a simple call to 
+                detach the object, and then attach it again later. Here are a few things to note with 
+                <i>attach/detach</i> :-
+            </p>
+            <ul>
+                <li>Calling <i>detachCopy</i> on an object that is not detachable will return a <b>transient</b> 
+                    instance that is a COPY of the original, so use the COPY thereafter.</li>
+                <li>Calling <i>detachCopy</i> on an object that is detachable will return a <b>detached</b> 
+                    instance that is a COPY of the original, so use this COPY thereafter</li>
+                <li>A <i>detached</i> object retain the id of its datastore entity. Detached objects should be used
+                    where you want to update the objects and attach them later (updating the associated object in the
+                    datastore. If you want to create copies of the objects in the datastore with their own identities
+                    you should use <i>makeTransient</i> instead of <i>detachCopy</i>.</li>
+                <li>Calling <i>detachCopy</i> will detach all fields of that object that are in the current 
+                    <a href="fetchgroups.html">Fetch Group</a> for that class for that <i>PersistenceManager</i>.</li>
+                <li>By default the fields of the object that will be detached are those in the <i>Default Fetch Group</i>.</li>
+                <li>You should choose your <a href="fetchgroups.html">Fetch Group</a> carefully, bearing in mind which
+                    object(s) you want to access whilst detached. Detaching a relation field will detach the related object
+                    as well.</li>
+                <li>If you don't detach a field of an object, you <u>cannot</u> access the value for that field while
+                    the object is detached.</li>
+                <li>If you don't detach a field of an object, you <u>can</u> update the value for that field while detached,
+                    and thereafter you can access the value for that field.</li>
+                <li>Calling <i>makePersistent</i> will return an (attached) copy of the detached object. It will attach all fields that
+                    were originally detached, and will also attach any other fields that were modified whilst detached.</li>
+            </ul>
+
+            <a name="detach_all_on_commit"/>
+            <subsection name="Detach All On Commit">
+                <p>
+                    JDO2 also provides a mechanism whereby all objects that were enlisted in a transaction are 
+                    automatically detached when the transaction is committed. You can enable this in one of 3 ways. 
+                    If you want to use this mode globally for all <i>PersistenceManager</i>s (PMs) from a 
+                    <i>PersistenceManagerFactory</i> (PMF) you could either set the PMF property 
+                    "datanucleus.DetachAllOnCommit", or you could create your PMF and call the PMF method 
+                    <b>setDetachAllOnCommit(true)</b>. If instead you wanted to use this mode only for a particular
+                    PM, or only for a particular transaction for a particular PM, then you can call the PM method
+                    <b>setDetachAllOnCommit(true)</b> before the commit of the transaction, and it will apply for all
+                    transaction commits thereafter, until turned off (<b>setDetachAllOnCommit(false)</b>. 
+                    Here's an example
+                </p>
+                <source>
+// Create a PMF
+...
+
+// Create an object
+MyObject my = new MyObject();
+
+PersistenceManager pm = pmf.getPersistenceManager();
+Transaction tx = pm.currentTransaction();
+try
+{
+    tx.begin();
+
+    // We want our object to be detached when it's been persisted
+    pm.setDetachAllOnCommit(true);
+
+    // Persist the object that we created earlier
+    pm.makePersistent(my);
+
+    tx.commit();
+    // The object "my" is now in detached state and can be used further
+}
+finally
+{
+    if (tx.isActive)
+    {
+        tx.rollback();
+    }
+}</source>
+                <br/>
+            </subsection>
+
+            <a name="copy_on_attach"/>
+            <subsection name="Copy On Attach">
+                <p>
+                    By default when you are attaching a detached object it will return an attached copy
+                    of the detached object. JDO2.1 provides a new feature that allows this attachment to
+                    just migrate the existing detached object into attached state.
+                </p>
+                <p>
+                    You enable this by setting the <i>PersistenceManagerFactory</i> (PMF) property
+                    <b>datanucleus.CopyOnAttach</b> to false. Alternatively you can use the methods
+                    <i>PersistenceManagerFactory.setCopyOnAttach(boolean flag)</i> or
+                    <i>PersistenceManager.setCopyOnAttach(boolean flag)</i>.
+                    If we return to the example at the start of this page, this now becomes
+                </p>
+                <source><![CDATA[
+// Reattach the updated object
+pm.setCopyOnAttach(false);
+tx = pm.currentTransaction();
+try
+{
+    tx.begin();
+
+    // working product is currently in detached state
+
+    pm.makePersistent(working_product);
+    // working_product is now in persistent (attached) state
+
+    tx.commit();
+}
+catch (Exception e)
+{
+    // Handle the exception
+}
+finally
+{
+    if (tx.isActive())
+    {
+        tx.rollback();
+    }
+}]]></source>
+                <p>
+                    Please note that if you try to attach two detached objects representing the same underlying 
+                    persistent object within the same transaction (i.e a persistent object with the same identity
+                    already exists in the level 1 cache), then a JDOUserException will be thrown.
+                </p>
+                <br/>
+            </subsection>
+
+            <subsection name="Serialization of Detachable classes">
+                <p>
+                    During enhancement of Detachable classes, a field called <i>jdoDetachedState</i> is added to 
+                    the class definition. This field allows reading and changing tracking of detached objects 
+                    while they are not managed by a PersistenceManager.
+                </p>
+                <p>
+                    When serialization occurs on a Detachable object, the <i>jdoDetachedState</i> field is written 
+                    to the serialized object stream. On deserialize, this field is written back to the new 
+                    deserialized instance. This process occurs transparently to the application. However, if 
+                    deserialization occurs with an un-enhanced version of the class, the detached state is lost.
+                </p>
+                <p>
+                    Serialization and deserialization of Detachable classes and un-enhanced versions of the same 
+                    class is only possible if the field <i>serialVersionUID</i> is added. It's recommended during 
+                    development of the class, to define the <i>serialVersionUID</i> and make the class to implement
+                    the <i>java.io.Serializable</i> interface, as the following example:
+                </p>
+<source>
+class MyClass implements java.io.Serializable
+{
+    private static final long serialVersionUID = 2765740961462495537L; // any random value here
+    
+    //.... other fields
+}
+</source>                        
+                <br/>
+            </subsection>
+        </section>
+
+    </body>
+</document>

Added: db/jdo/site/src/site/xdoc/class_types.xml
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/xdoc/class_types.xml?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/xdoc/class_types.xml (added)
+++ db/jdo/site/src/site/xdoc/class_types.xml Sun Jan 13 17:05:15 2013
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+    <properties>
+        <title>JDO Class Types</title>
+    </properties>
+
+    <body>
+        <section name="JDO Class Types">
+            <p>
+                JDO provides a means of transparent persistence of objects of user defined classes. With JDO there are actually 
+                3 types of classes.
+            </p>
+            <ul>
+                <li><b>Persistence Capable</b> classes are classes whose instances can be persisted to a datastore. JDO provide the 
+                    mechanism for persisting these instances, and they are core to JDO. These classes need to be <i>enhanced</i> 
+                    according to a JDO Meta-Data specification before use within a JDO environment.</li>
+                <li><b>Persistence Aware</b> classes are classes that manipulate Persistence Capable instances through direct attribute 
+                    manipulation. These classes are typically enhanced with very minimal JDO Meta-Data. The enhancement process performs very 
+                    little changes to these classes.</li>
+                <li><b>Normal</b> classes are classes that aren't themselves persistable, and have no knowledge of persistence either. 
+                    These classes are totally unchanged in JDO, and require no JDO Meta-Data whatsoever.</li>
+            </ul>
+
+            <subsection name="PersistenceCapable">
+                <p>
+                    Classes are defined as <b>PersistenceCapable</b> either by XML MetaData, like this
+                </p>
+                <source><![CDATA[
+<class name="MyClass">
+    ...
+</class>]]></source>
+                <p>
+                    or, in JDO2.1, using Annotations. Like this
+                </p>
+                <source>
+@PersistenceCapable
+public class MyClass
+{
+    ...
+}</source>
+                <br/>
+            </subsection>
+
+            <subsection name="PersistenceAware">
+                <p>
+                    Classes are defined as <b>PersistenceAware</b> either by XML MetaData, like this
+                </p>
+                <source><![CDATA[
+<class name="MyClass" persistence-modifier="persistence-aware"/>]]></source>
+                <p>
+                    or, in JDO2.1, using Annotations. Like this
+                </p>
+                <source>
+@PersistenceAware
+public class MyClass
+{
+    ...
+}</source>
+                <br/>
+            </subsection>
+        </section>
+
+    </body>
+</document>

Added: db/jdo/site/src/site/xdoc/dependencies.xml
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/xdoc/dependencies.xml?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/xdoc/dependencies.xml (added)
+++ db/jdo/site/src/site/xdoc/dependencies.xml Sun Jan 13 17:05:15 2013
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+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.
+
+-->
+
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+ <properties>
+  <title>Project Dependencies</title>
+  <author email="jdo-dev@db.apache.org">JDO Documentation Team</author>
+ </properties>
+
+ <body>
+  <section name="The Apache JDO Project">
+
+    <p>
+    Apache JDO is a sub-project of the Apache DB TLP. It includes two major areas:
+    </p>
+    <ul>
+    <li>
+JDO 1, Java Specification Request 12, API, Reference Implementation, and 
+Technology Compatibility Kit.
+    </li>
+    <li>
+JDO 2, Java Specification Request 243, API, and Technology Compatibility Kit.
+The Reference Implementation is being developed in parallel by <a href="http://www.jpox.org">JPOX</a>.
+    </li>
+    </ul>
+
+  <p> 
+  The common external dependencies of JDO include the tools used to build and test it:
+  </p>
+
+  <ul>
+    <li>Subversion</li>
+    <li>Maven</li>
+    <li>Ant</li>
+    <li>JUnit</li>
+  </ul>
+
+  <p>
+  Other external dependencies of JDO are subproject-specific:
+  </p>
+
+  <ul>
+    <li>JDO 2.0 API
+      <ul>
+        <li>Java Transaction API</li>
+      </ul>
+    </li>
+    <li>JDO 2.0 TCK
+      <ul>
+        <li>Java Transaction API</li>
+        <li>Jakarta Commons Logging</li>
+        <li>Log4j</li>
+        <li>Apache Derby</li>
+        <li>Spring Framework Core</li>
+        <li>JPOX
+          <ul>
+            <li>ASM</li>
+            <li>Source Forge c3p0</li>
+            <li>Commons DBCP</li>
+            <li>Commons Pool</li>
+            <li>Commons Collections</li>
+          </ul>
+        </li>
+      </ul>
+    </li>
+  </ul>
+</section>
+
+</body>
+</document>
+   

Added: db/jdo/site/src/site/xdoc/downloads.xml
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/xdoc/downloads.xml?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/xdoc/downloads.xml (added)
+++ db/jdo/site/src/site/xdoc/downloads.xml Sun Jan 13 17:05:15 2013
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+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.
+-->
+
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+    <properties>
+        <title>Downloads</title>
+        <author email="jdo-dev@db.apache.org">JDO Documentation Team</author>
+    </properties>
+    <body>
+    <section name="Latest Official Release">
+        <p>
+            <a href="releases/release-3.0.1.cgi">JDO 3.0.1</a> 
+            <img vspace="0" hspace="8" src="images/dot_clear.gif" alt=""/>
+            November 13, 2011
+        </p>
+    </section>
+
+    <section name="Previous Official Releases">
+        <p>
+            <a href="releases/release-3.0.cgi">JDO 3.0</a> 
+            <img vspace="0" hspace="8" src="images/dot_clear.gif" alt=""/>
+            July 23, 2010
+        </p>
+        <p>
+            <a href="releases/release-2.2.cgi">JDO 2.2</a> 
+            <img vspace="0" hspace="8" src="images/dot_clear.gif" alt=""/>
+            October 24, 2008
+        </p>
+        <p>
+            <a href="releases/release-2.1.1.cgi">JDO 2.1.1</a> 
+            <img vspace="0" hspace="8" src="images/dot_clear.gif" alt=""/>
+            August 29, 2008
+        </p>
+        <p>
+            <a href="releases/release-2.1.cgi">JDO 2.1</a> 
+            <img vspace="0" hspace="8" src="images/dot_clear.gif" alt=""/>
+            March 17, 2008
+        </p>
+        <p>
+            <a href="releases/release-2.0.cgi">JDO 2.0</a> 
+            <img vspace="0" hspace="8" src="images/dot_clear.gif" alt=""/>
+            May 1, 2006
+        </p>
+<!--
+<p>
+<a href="releases/release-2.0-rc1.cgi">JDO 2.0 rc1</a> 
+<img vspace="0" hspace="8" SRC="images/dot_clear.gif"/>
+Feb 27, 2006
+</p>
+<p>
+<a href="releases/release-2.0-beta.cgi">JDO 2.0 beta</a> 
+<img vspace="0" hspace="8" SRC="images/dot_clear.gif"/>
+Jan 24, 2006
+            </p>
+-->
+</section>
+
+    <section name="About JDO Releases">
+        <p>
+            A release of JDO includes the JDO API and the
+            Technology Compatibility Kit (TCK).
+            The TCK is available only in source form. The API
+            project is available as source and binary, and as raw jar files.
+        </p>
+        <ul>
+            <li> 
+            The api project contains source to build jdo-api.jar.
+            The jar file is the only artifact needed for users who wish to compile 
+            their programs using the JDO API.
+            It can be downloaded automatically by maven and placed into the local
+            maven repository if you include the
+            proper dependency in your maven project definition. 
+            Use groupId javax.jdo, artifactId jdo-api, version 3.0,
+            and define your remote repository as 
+            http://www.ibiblio.org/maven.
+            Alternatively, it can be downloaded manually and put into a location 
+            of your choice.
+            </li>
+            <li> 
+            The tck project contains the JDO Technology Compatibility Kit. 
+            The source distribution is the only artifact needed to be downloaded 
+            by the user. 
+            </li>
+        </ul>
+        <p>
+            All are available for download as source, but if you wish
+            to run the TCK you need only download the TCK project.  
+            The dependencies will be automatically downloaded by maven
+            as jar files.
+        </p>
+        <p>
+            For information on running the TCK, see <a href="tck.html">TCK</a>.
+            If downloading multiple source packages, extract them all
+            into the same directory. This will preserve the source
+            dependencies among the projects.
+        </p>
+        <p>
+            See <a href="svn.html">Source Code Version Control</a> for information about downloading the latest source code for all of the JDO projects.
+        </p>
+    </section>
+    </body>
+</document>

Added: db/jdo/site/src/site/xdoc/enhancement.xml
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/xdoc/enhancement.xml?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/xdoc/enhancement.xml (added)
+++ db/jdo/site/src/site/xdoc/enhancement.xml Sun Jan 13 17:05:15 2013
@@ -0,0 +1,560 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+    <properties>
+        <title>JDO Enhancement</title>
+    </properties>
+
+    <body>
+        <section name="JDO Enhancement">
+            <p>
+                JDO defines a byte-code enhancement process that provides for dirty detection of fields.
+                Before a class is used at runtime it is compiled and then "enhanced" to implement the interface
+                <i>PersistenceCapable</i>, and optionally also <i>Detachable</i>.
+            </p>
+            <p>
+                We can demonstrate this by taking a sample class, and seeing it before and after enhancement.
+                We start with the following class
+            </p>
+            <source><![CDATA[
+package org.apache.jdo.test;
+
+public class A
+{
+    long id;
+    String name;
+    B b;
+
+    public A(String name)
+    {
+        this.name = name;
+    }
+
+    public void setId(long id)
+    {
+        this.id = id;
+    }
+
+    public void setB(B b)
+    {
+        this.b = b;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public B getB()
+    {
+        return b;
+    }
+
+    public long getId()
+    {
+        return id;
+    }
+
+    public String toString()
+    {
+        return "A : id=" + id + " [" + name + "] b=\"" + b + "\"";
+    }
+}]]></source>
+            <p>
+                and require it to be <i>PersistenceCapable</i> and <i>Detachable</i>. 
+                The enhancement process needs to intercept all updates of the fields of the class (id, name, b) as well
+                as add on the necessary <i>PersistenceCapable</i>, <i>Detachable</i> methods.
+                After "enhancement" it becomes
+            </p>
+            <source><![CDATA[
+package org.apache.jdo.test;
+import java.util.BitSet;
+
+import javax.jdo.JDODetachedFieldAccessException;
+import javax.jdo.JDOFatalInternalException;
+import javax.jdo.PersistenceManager;
+import javax.jdo.identity.LongIdentity;
+import javax.jdo.spi.Detachable;
+import javax.jdo.spi.JDOImplHelper;
+import javax.jdo.spi.JDOPermission;
+import javax.jdo.spi.PersistenceCapable;
+import javax.jdo.spi.StateManager;
+
+public class A implements PersistenceCapable, Detachable
+{
+    long id;
+    String name;
+    B b;
+    protected transient StateManager jdoStateManager;
+    protected transient byte jdoFlags;
+    protected Object[] jdoDetachedState;
+    private static final byte[] jdoFieldFlags;
+    private static final Class jdoPersistenceCapableSuperclass;
+    private static final Class[] jdoFieldTypes;
+    private static final String[] jdoFieldNames = __jdoFieldNamesInit();
+    private static final int jdoInheritedFieldCount;
+
+    static
+    {
+        jdoFieldTypes = __jdoFieldTypesInit();
+        jdoFieldFlags = __jdoFieldFlagsInit();
+        jdoInheritedFieldCount = __jdoGetInheritedFieldCount();
+        jdoPersistenceCapableSuperclass = __jdoPersistenceCapableSuperclassInit();
+        JDOImplHelper.registerClass(___jdo$loadClass("org.apache.jdo.test.A"),
+                    jdoFieldNames, jdoFieldTypes,
+                    jdoFieldFlags,
+                    jdoPersistenceCapableSuperclass, new A());
+    }
+    
+    public void setId(long id)
+    {
+        jdoSetid(this, id);
+    }
+    
+    public void setB(B b)
+    {
+        jdoSetb(this, b);
+    }
+    
+    public String getName()
+    {
+        return jdoGetname(this);
+    }
+    
+    public B getB()
+    {
+        return jdoGetb(this);
+    }
+    
+    public long getId()
+    {
+        return jdoGetid(this);
+    }
+    
+    public String toString()
+    {
+        return new StringBuilder().append("A : id=").append(jdoGetid(this))
+           .append(" [").append(jdoGetname(this))
+           .append("] b=\"").append(jdoGetb(this))
+           .append("\"").toString();
+    }
+
+    public void jdoCopyKeyFieldsFromObjectId(PersistenceCapable.ObjectIdFieldConsumer fc, Object oid)
+    {
+        if (fc == null)
+            throw new IllegalArgumentException
+              ("ObjectIdFieldConsumer is null");
+        if (!(oid instanceof LongIdentity))
+            throw new ClassCastException
+              ("oid is not instanceof javax.jdo.identity.LongIdentity");
+        LongIdentity o = (LongIdentity) oid;
+        fc.storeLongField(1, o.getKey());
+    }
+    
+    protected void jdoCopyKeyFieldsFromObjectId(Object oid)
+    {
+        if (!(oid instanceof LongIdentity))
+            throw new ClassCastException
+              ("key class is not javax.jdo.identity.LongIdentity or null");
+        LongIdentity o = (LongIdentity) oid;
+        id = o.getKey();
+    }
+    
+    public final void jdoCopyKeyFieldsToObjectId(Object oid)
+    {
+        throw new JDOFatalInternalException
+          ("It's illegal to call jdoCopyKeyFieldsToObjectId for a class with Single Field Identity.");
+    }
+    
+    public final void jdoCopyKeyFieldsToObjectId
+    (PersistenceCapable.ObjectIdFieldSupplier fs, Object oid) {
+    throw new JDOFatalInternalException
+          ("It's illegal to call jdoCopyKeyFieldsToObjectId for a class with Single Field Identity.");
+    }
+    
+    public final Object jdoGetObjectId()
+    {
+        if (jdoStateManager != null)
+            return jdoStateManager.getObjectId(this);
+        if (this.jdoIsDetached() != true)
+            return null;
+        return jdoDetachedState[0];
+    }
+    
+    public final Object jdoGetVersion()
+    {
+        if (jdoStateManager != null)
+            return jdoStateManager.getVersion(this);
+        if (this.jdoIsDetached() != true)
+            return null;
+        return jdoDetachedState[1];
+    }
+    
+    protected final void jdoPreSerialize()
+    {
+        if (jdoStateManager != null)
+            jdoStateManager.preSerialize(this);
+    }
+    
+    public final PersistenceManager jdoGetPersistenceManager()
+    {
+        return (jdoStateManager != null
+            ? jdoStateManager.getPersistenceManager(this) : null);
+    }
+    
+    public final Object jdoGetTransactionalObjectId() 
+    {
+        return (jdoStateManager != null
+           ? jdoStateManager.getTransactionalObjectId(this) : null);
+    }
+    
+    public final boolean jdoIsDeleted()
+    {
+        return (jdoStateManager != null ? jdoStateManager.isDeleted(this): false);
+    }
+    
+    public final boolean jdoIsDirty()
+    {
+        if (jdoStateManager != null)
+            return jdoStateManager.isDirty(this);
+        if (this.jdoIsDetached() != true)
+            return false;
+        if (((BitSet) jdoDetachedState[3]).length() <= 0)
+            return false;
+        return true;
+    }
+    
+    public final boolean jdoIsNew()
+    {
+        return jdoStateManager != null ? jdoStateManager.isNew(this) : false;
+    }
+    
+    public final boolean jdoIsPersistent()
+    {
+        return (jdoStateManager != null ? jdoStateManager.isPersistent(this): false);
+    }
+    
+    public final boolean jdoIsTransactional()
+    {
+        return (jdoStateManager != null ? jdoStateManager.isTransactional(this): false);
+    }
+    
+    public final boolean jdoIsDetached()
+    {
+        if (jdoStateManager == null) {
+            if (jdoDetachedState == null)
+                return false;
+            return true;
+        }
+        return false;
+    }
+    
+    public final void jdoMakeDirty(String fieldName)
+    {
+        if (jdoStateManager != null)
+            jdoStateManager.makeDirty(this, fieldName);
+    }
+    
+    public final Object jdoNewObjectIdInstance() 
+    {
+        return new LongIdentity(getClass(), id);
+    }
+    
+    public final Object jdoNewObjectIdInstance(Object key) 
+    {
+        if (key == null)
+            throw new IllegalArgumentException("key is null");
+        if (key instanceof String != true)
+            return new LongIdentity(this.getClass(), (Long) key);
+        return new LongIdentity(this.getClass(), (String) key);
+    }
+    
+    public final void jdoProvideFields(int[] fieldId)
+    {
+        if (fieldId == null)
+            throw new IllegalArgumentException("argment is null");
+        int i = fieldId.length - 1;
+        if (i >= 0)
+        {
+            do
+                jdoProvideField(fieldId[i]);
+            while (--i >= 0);
+        }
+    }
+    
+    public final void jdoReplaceFields(int[] fieldId) 
+    {
+        if (fieldId == null)
+            throw new IllegalArgumentException("argument is null");
+        int i = fieldId.length;
+        if (i > 0)
+        {
+            int i_0_ = 0;
+            do
+                jdoReplaceField(fieldId[i_0_]);
+            while (++i_0_ < i);
+        }
+    }
+    
+    public final void jdoReplaceFlags()
+    {
+        if (jdoStateManager != null) 
+        {
+            A a = this;
+            a.jdoFlags = a.jdoStateManager.replacingFlags(this);
+        }
+    }
+    
+    public final synchronized void jdoReplaceStateManager(StateManager stateManager)
+    {
+        if (jdoStateManager != null)
+        {
+            A a = this;
+            a.jdoStateManager = a.jdoStateManager.replacingStateManager(this, stateManager);
+        }
+        else
+        {
+            JDOImplHelper.checkAuthorizedStateManager(sm);
+            jdoStateManager = stateManager;
+            jdoFlags = (byte) 1;
+        }
+    }
+    
+    public final synchronized void jdoReplaceDetachedState()
+    {
+        if (jdoStateManager == null)
+            throw new IllegalStateException("state manager is null");
+        A a = this;
+        a.jdoDetachedState = a.jdoStateManager.replacingDetachedState(this, jdoDetachedState);
+    }
+    
+    public PersistenceCapable jdoNewInstance(StateManager sm)
+    {
+        A result = new A();
+        A a = result;
+        a.jdoFlags = (byte) 1;
+        a.jdoStateManager = sm;
+        return a;
+    }
+    
+    public PersistenceCapable jdoNewInstance(StateManager sm, Object o)
+    {
+        A result = new A();
+        A a = result;
+        a.jdoFlags = (byte) 1;
+        a.jdoStateManager = sm;
+        result.jdoCopyKeyFieldsFromObjectId(o);
+        return a;
+    }
+    
+    public void jdoReplaceField(int fieldIndex)
+    {
+        if (jdoStateManager == null)
+            throw new IllegalStateException("state manager is null");
+        switch (fieldIndex)
+        {
+            case 0:
+            {
+                A a = this;
+                a.b = (B) a.jdoStateManager.replacingObjectField(this, fieldIndex);
+                break;
+            }
+            case 1:
+            {
+                A a = this;
+                a.id = a.jdoStateManager.replacingLongField(this, fieldIndex);
+                break;
+            }
+            case 2:
+            {
+                A a = this;
+                a.name = a.jdoStateManager.replacingStringField(this, fieldIndex);
+                break;
+            }
+            default:
+                throw new IllegalArgumentException("out of field index :" + fieldIndex);
+        }
+    }
+    
+    public void jdoProvideField(int fieldIndex)
+    {
+        if (jdoStateManager == null)
+            throw new IllegalStateException("state manager is null");
+        switch (fieldIndex)
+        {
+            case 0:
+                jdoStateManager.providedObjectField(this, fieldIndex, b);
+                break;
+            case 1:
+                jdoStateManager.providedLongField(this, fieldIndex, id);
+                break;
+            case 2:
+                jdoStateManager.providedStringField(this, fieldIndex, name);
+                break;
+            default:
+                throw new IllegalArgumentException("out of field index :" + fieldIndex);
+         }
+    }
+    
+    protected final void jdoCopyField(A obj, int index)
+    {
+        switch (index)
+        {
+            case 0:
+                b = obj.b;
+                break;
+            case 1:
+                id = obj.id;
+                break;
+            case 2:
+                name = obj.name;
+                break;
+            default:
+                throw new IllegalArgumentException("out of field index :" + index);
+        }
+    }
+    
+    public void jdoCopyFields(Object obj, int[] fieldNumbers)
+    {
+        if (jdoStateManager == null)
+            throw new IllegalStateException("state manager is null");
+        if (fieldNumbers == null)
+            throw new IllegalStateException("fieldNumbers is null");
+        if (obj instanceof A != true)
+            throw new IllegalArgumentException("object is not org.apache.jdo.test.A");
+        A me = (A) obj;
+        if (jdoStateManager != me.jdoStateManager)
+            throw new IllegalArgumentException("state manager unmatch");
+        int i = fieldNumbers.length - 1;
+        if (i >= 0)
+        {
+            do
+                jdoCopyField(me, fieldNumbers[i]);
+            while (--i >= 0);
+        }
+    }
+    
+    private static final String[] __jdoFieldNamesInit()
+    {
+        return new String[] { "b", "id", "name" };
+    }
+    
+    private static final Class[] __jdoFieldTypesInit()
+    {
+        return new Class[] { ___jdo$loadClass("org.apache.jdo.test.B"), Long.TYPE,
+                 ___jdo$loadClass("java.lang.String") };
+    }
+    
+    private static final byte[] __jdoFieldFlagsInit()
+    {
+        return new byte[] { 10, 24, 21 };
+    }
+    
+    protected static int __jdoGetInheritedFieldCount()
+    {
+        return 0;
+    }
+    
+    protected static int jdoGetManagedFieldCount()
+    {
+        return 3;
+    }
+    
+    private static Class __jdoPersistenceCapableSuperclassInit()
+    {
+        return null;
+    }
+    
+    public static Class ___jdo$loadClass(String className)
+    {
+        try
+        {
+            return Class.forName(className);
+        }
+        catch (ClassNotFoundException e)
+        {
+            throw new NoClassDefFoundError(e.getMessage());
+        }
+    }
+    
+    private Object jdoSuperClone()
+    throws CloneNotSupportedException
+    {
+        A o = (A) super.clone();
+        o.jdoFlags = (byte) 0;
+        o.jdoStateManager = null;
+        return o;
+    }
+    
+    public A() 
+    {
+        /* empty */
+    }
+    
+    static void jdoSetb(A objPC, B b_m)
+    {
+        if (objPC.jdoStateManager == null)
+            objPC.b = b_m;
+        else
+            objPC.jdoStateManager.setObjectField(objPC, 0, objPC.b, b_m);
+        if (objPC.jdoIsDetached() == true)
+            ((BitSet) objPC.jdoDetachedState[3]).set(0);
+    }
+    
+    static B jdoGetb(A objPC)
+    {
+        if (objPC.jdoStateManager != null
+        && !objPC.jdoStateManager.isLoaded(objPC, 0))
+            return (B) objPC.jdoStateManager.getObjectField(objPC, 0, objPC.b);
+        if (objPC.jdoIsDetached() != false
+        && ((BitSet) objPC.jdoDetachedState[2]).get(0) != true
+        && ((BitSet) objPC.jdoDetachedState[3]).get(0) != true)
+            throw new JDODetachedFieldAccessException
+              ("You have just attempted to access field \"b\" yet this field was not detached when you detached the object. " +
+               "Either dont access this field, or detach the field when detaching the object.");
+        return objPC.b;
+    }
+    
+    static void jdoSetid(A objPC, long id_n)
+    {
+        objPC.id = id_n;
+    }
+    
+    static long jdoGetid(A objPC)
+    {
+        return objPC.id;
+    }
+    
+    static void jdoSetname(A objPC, String name_c)
+    {
+        if (objPC.jdoFlags != 0 && objPC.jdoStateManager != null)
+            objPC.jdoStateManager.setStringField(objPC, 2, objPC.name, name_c);
+        else
+        {
+            objPC.name = name_c;
+            if (objPC.jdoIsDetached() == true)
+                ((BitSet) objPC.jdoDetachedState[3]).set(2);
+        }
+    }
+    
+    static String jdoGetname(A objPC)
+    {
+        if (objPC.jdoFlags > 0 && objPC.jdoStateManager != null && !objPC.jdoStateManager.isLoaded(objPC, 2))
+            return objPC.jdoStateManager.getStringField(objPC, 2, objPC.name);
+        if (objPC.jdoIsDetached() != false && ((BitSet) objPC.jdoDetachedState[2]).get(2) != true)
+            throw new JDODetachedFieldAccessException
+              ("You have just attempted to access field \"name\" yet this field was not detached when you detached the object." +
+               "Either dont access this field, or detach the field when detaching the object.");
+        return objPC.name;
+    }
+
+    public A(String name)
+    {
+        jdoSetname(this, name);
+    }
+}]]></source>
+        </section>
+
+    </body>
+</document>

Added: db/jdo/site/src/site/xdoc/exceptions.xml
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/xdoc/exceptions.xml?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/xdoc/exceptions.xml (added)
+++ db/jdo/site/src/site/xdoc/exceptions.xml Sun Jan 13 17:05:15 2013
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+    <properties>
+        <title>JDO Exceptions</title>
+    </properties>
+
+    <body>
+        <section name="JDO Exceptions">
+            <p>
+                All exceptions raised by a JDO implementation are runtime exceptions which means that you can choose to catch 
+                the exceptions or not. The reason for JDO using <i>unchecked</i> exceptions is that JDO tries to provide transparent
+                persistence, and so needs to present the same interface and exceptions whatever the state an object has.
+            </p>
+
+            <subsection name="JDOException">
+                <p>
+                    This is the base class for all JDO exceptions. It is a subclass of RuntimeException, and need not be declared or caught.
+                </p>
+                <br/>
+            </subsection>
+
+            <subsection name="Can Retry Exceptions">
+                <center>
+                    <img src="images/jdo_exception_canretry.jpg" border="0" alt="JDO Can Retry Exceptions"/>
+                </center>
+                <table>
+                    <tr>
+                        <th>Exception</th><th>Description</th>
+                    </tr>
+                    <tr>
+                        <td>JDOCanRetryException</td>
+                        <td>This is the base class for errors that can be retried.</td>
+                    </tr>
+                    <tr>
+                        <td>JDOUserException</td>
+                        <td>This is the base class for user errors that can be retried.</td>
+                    </tr>
+                    <tr>
+                        <td>JDODataStoreException</td>
+                        <td>This is the base class for datastore errors that can be retried.
+                            Any root SQLException that caused this will typically be nested within this exception.</td>
+                    </tr>
+                    <tr>
+                        <td>JDOObjectNotFoundException</td>
+                        <td>This exception is to notify the application that an object does not exist in the 
+                            datastore. When this exception is thrown during a transaction, there has been no change 
+                            in the status of the transaction in progress. If this exception is a nested exception 
+                            thrown during commit, then the transaction is rolled back.</td>
+                    </tr>
+                    <tr>
+                        <td>JDOUnsupportedOptionException</td>
+                        <td>This exception is thrown by an implementation to indicate that it does not implement a 
+                            JDO optional feature.</td>
+                    </tr>
+                </table>
+                <br/>
+            </subsection>
+            
+            <subsection name="Fatal Exceptions">
+                <center>
+                    <img src="images/jdo_exception_fatal.jpg" border="0" alt="JDO Fatal Exceptions"/>
+                </center>
+                <table>
+                    <tr>
+                        <th>Exception</th><th>Description</th>
+                    </tr>
+                    <tr>
+                        <td>JDOFatalException</td>
+                        <td>This is the base class for errors that cannot be retried. This exception generally 
+                            means that the transaction associated with the PersistenceManager has been rolled back, 
+                            and the transaction should be abandoned.</td>
+                    </tr>
+                    <tr>
+                        <td>JDOFatalUserException</td>
+                        <td>This is the base class for user errors that cannot be retried.</td>
+                    </tr>
+                    <tr>
+                        <td>JDOFatalInternalException</td>
+                        <td>This is the base class for JDO implementation failures.</td>
+                    </tr>
+                    <tr>
+                        <td>JDOFatalDataStoreException</td>
+                        <td>This is the base class for fatal datastore errors. When this exception is thrown, the 
+                            transaction has been rolled back. Any root SQLException that caused this will typically be nested 
+                            within this exception.</td>
+                    </tr>
+                    <tr>
+                        <td>JDOOptimisticVerificationException</td>
+                        <td>This exception is the result of a user commit operation in an optimistic transaction 
+                            where the verification of new, modified, or deleted instances fails the verification. 
+                            The user will never see this exception except as a result of commit.</td>
+                    </tr>
+                    <tr>
+                        <td>JDODetachedFieldAccessException</td>
+                        <td>This exception is the result of a user accessing a field of a detached instance, where 
+                            the field was not copied to the detached instance.</td>
+                    </tr>
+                </table>            
+            </subsection>
+        </section>
+    </body>
+</document>

Added: db/jdo/site/src/site/xdoc/extents.xml
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/xdoc/extents.xml?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/xdoc/extents.xml (added)
+++ db/jdo/site/src/site/xdoc/extents.xml Sun Jan 13 17:05:15 2013
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+    <properties>
+        <title>JDO Extents</title>
+    </properties>
+
+    <body>
+        <section name="JDO Extents">
+            <p>
+                JDO implementations manage the persistence of objects into the datastore. An <b>Extent</b>
+                is a collection of objects of a particular type of object that have been persisted. When you define
+                the MetaData for a class you can define if the class requires an Extent. The default is true.
+                You access the Extent as follows
+            </p>
+            <source>
+Extent e = pm.getExtent(MyClass.class, true);
+            </source>
+            <p>
+                This example will return an Extent that contains all persisted instances of the class <i>MyClass</i>
+                and its subclasses (the second argument in the call). An Extent is useful where you want to restrict a
+                Query to query over just that set of objects. It can also be used where you just want to retrieve
+                all persisted objects of a type (as an alternative to using a Query).
+            </p>
+        </section>
+
+    </body>
+</document>

Added: db/jdo/site/src/site/xdoc/faq.xml
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/xdoc/faq.xml?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/xdoc/faq.xml (added)
+++ db/jdo/site/src/site/xdoc/faq.xml Sun Jan 13 17:05:15 2013
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+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.
+-->
+  
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+
+ <properties>
+  <title>FAQ</title>
+  <author email="jdo-dev@db.apache.org">JDO Documentation Team</author>
+ </properties>
+
+ <body>
+  <section name="General">
+
+  <p>
+     <strong>What is JDO?</strong>
+      <cite>
+        JDO is Java Data Objects, a datastore-agnostic interface
+        for storing Java objects in transactional datastores.
+      </cite>
+  </p>
+
+  <p>
+      <strong>I'd like to find out more about the project and possibly contribute. What do I do next?</strong>
+      <cite>Participation on the project is via the mailing
+        list and the source code repository. You join by subscribing
+        to the mailing list and participating in discussions. You
+        can help by contributing your ideas, enthusiasm, code,
+        documentation, and tests. The fundamental tenet of the Apache
+        Software Foundation is that great communities build great
+        code. The emphasis is on community; the code comes from that.
+        If you want to help, just join the mailing list, see what
+        needs to be done, and do it. Welcome!
+      </cite>
+    </p> 
+   
+   <p> 
+      <strong>Where is the mailing list, and how can I subscribe?</strong>
+      <cite>
+        The developers mailing list is jdo-dev@db.apache.org, a
+        high-volume list currently receiving from 100 to 300 messages
+        a month. 
+        <br/>
+        The users mailing list is jdo-user@db.apache.org.
+      </cite>
+    </p>
+
+<p>
+      <strong>Does this project use a wiki?</strong>
+      <cite>
+        It does - the
+        <a href="http://wiki.apache.org/jdo">JDO wiki</a>
+        complements the work taking place on the mailing list and provides
+        additional information on the project. 
+      </cite>
+</p>
+</section>
+
+</body>
+</document>
+   

Added: db/jdo/site/src/site/xdoc/fetchgroups.xml
URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/xdoc/fetchgroups.xml?rev=1432659&view=auto
==============================================================================
--- db/jdo/site/src/site/xdoc/fetchgroups.xml (added)
+++ db/jdo/site/src/site/xdoc/fetchgroups.xml Sun Jan 13 17:05:15 2013
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+    <properties>
+        <title>Fetch-Groups</title>
+    </properties>
+
+    <body>
+        <section name="Fetch Groups">
+            <p>
+                When an object is retrieved from the datastore by JDO typically not all fields are retrieved immediately.
+                This is because for efficiency purposes only particular field types are retrieved in the initial access 
+                of the object, and then any other objects are retrieved when accessed (lazy loading). 
+                The group of fields that are loaded is called a <b>fetch group</b>.
+                There are 3 types of "fetch groups" to consider
+            </p>
+            <ul>
+                <li><a href="#dfg">Default Fetch Group</a> : defined in all JDO specs, containing the fields 
+                    of a class that will be retrieved by default (with no user specification).</li>
+                <li><a href="#static">Named Fetch Groups</a> : defined by the JDO2 specification, and defined
+                    in MetaData (XML/annotations) with the fields of a class that are part of that fetch group.
+                    The definition here is <i>static</i></li>
+                <li><a href="#dynamic">Dynamic Fetch Groups</a> : Programmatic definition of fetch groups at 
+                    runtime via an API</li>
+            </ul>
+            <p>
+                The <b>fetch group</b> in use for a class is controled via the <i>FetchPlan</i>
+                <a href="http://db.apache.org/jdo/api20/apidocs/javax/jdo/FetchPlan.html" target="_blank"><img src="images/javadoc.gif" alt=""/></a>
+                interface. To get a handle on the current <i>FetchPlan</i> we do
+            </p>
+            <source>FetchPlan fp = pm.getFetchPlan();</source>
+            <br/>
+
+            <a name="dfg"/>
+            <subsection name="Default Fetch Group">
+                <p>
+                    JDO provides an initial fetch group, comprising the fields that will be retrieved when an object 
+                    is retrieved if the user does nothing to define the required behaviour. By default the <i>default 
+                    fetch group</i> comprises all fields of the following types :-
+                </p>
+                <ul>
+                    <li>primitives : boolean, byte, char, double, float, int, long, short</li>
+                    <li>Object wrappers of primitives : Boolean, Byte, Character, Double, Float, Integer, Long, Short</li>
+                    <li>java.lang.String, java.lang.Number, java.lang.Enum</li>
+                    <li>java.math.BigDecimal, java.math.BigInteger</li>
+                    <li>java.util.Date</li>
+                </ul>
+                <p>
+                    If you wish to change the <b>Default Fetch Group</b> for a class you can update the Meta-Data 
+                    for the class as follows (for XML)
+                </p>
+                <source><![CDATA[
+<class name="MyClass">
+    ...
+    <field name="fieldX" default-fetch-group="true"/>
+</class>]]></source>
+                <p>or using annotations</p>
+                <source><![CDATA[
+@Persistent(defaultFetchGroup="true")
+SomeType fieldX;]]></source>
+                <p>
+                    When a <i>PersistenceManager</i> is created it starts with a FetchPlan of the "default" fetch group. 
+                    That is, if we call
+                </p>
+                <source>Collection fetchGroups = fp.getGroups();</source>
+                <p>
+                    this will have one group, called "default". At runtime, if you have been using other 
+                    fetch groups and want to revert back to the default fetch group at any time you simply do
+                </p>
+                <source>fp.setGroup(FetchPlan.DEFAULT);</source>
+                <br/>
+            </subsection>
+
+            <a name="static"/>
+            <subsection name="Named Fetch Groups">
+                <p>
+                    As mentioned above, JDO allows specification of users own fetch groups. These are specified in the 
+                    MetaData of the class. For example, if we have the following class
+                </p>
+                <source>
+class MyClass
+{
+    String name;
+    HashSet coll;
+    MyOtherClass other;
+}</source>
+                <p>
+                    and we want to have the <u>other</u> field loaded whenever we load objects of this class, we define 
+                    our MetaData as
+                </p>
+                <source><![CDATA[
+<package name="mydomain">
+    <class name="MyClass">
+        <field name="name">
+            <column length="100" jdbc-type="VARCHAR"/>
+        </field>
+        <field name="coll" persistence-modifier="persistent">
+            <collection element-type="mydomain.Address"/>
+            <join/>
+        </field>
+        <field name="other" persistence-modifier="persistent"/>
+        <fetch-group name="otherfield">
+            <field name="other"/>
+        </fetch-group>
+    </class>
+</package>]]></source>
+                <p>or using annotations</p>
+                <source><![CDATA[
+@PersistenceCapable
+@FetchGroup(name="otherfield", members={@Persistent(name="other")})
+public class MyClass
+{
+    ...
+}]]></source>
+                <p>
+                    So we have defined a fetch group called "otherfield" that just includes the field with name 
+                    <i>other</i>. We can then use this at runtime in our persistence code.
+                </p>
+                <source>
+PersistenceManager pm = pmf.getPersistenceManager();
+pm.getFetchPlan().addGroup("otherfield");
+
+... (load MyClass object)</source>
+                <p>
+                    By default the <i>FetchPlan</i> will include the default fetch group. We have changed this above by
+                    <u>adding</u> the fetch group "otherfield", so when we retrieve an object using this 
+                    <i>PersistenceManager</i> we will be retrieving the fields <i>name</i> AND <i>other</i> since they
+                    are both in the current <i>FetchPlan</i>. We can take the above much further than what is shown by 
+                    defining nested fetch groups in the MetaData. In addition we can change the <i>FetchPlan</i> just
+                    before any <i>PersistenceManager</i> operation to control what is fetched during that operation.
+                    The user has full flexibility to add many groups to the current <b>Fetch Plan</b>.
+                    This gives much power and control over what will be loaded and when.
+                </p>
+                <p>
+                    The <i>FetchPlan</i> applies not just to calls to <i>PersistenceManager.getObjectById()</i>, but also
+                    to <i>PersistenceManager.newQuery()</i>, <i>PersistenceManager.getExtent()</i>, 
+                    <i>PersistenceManager.detachCopy</i> and much more besides.
+                </p>
+                <p>
+                    You can read more about <b>named fetch-groups</b> and how to use it with 
+                    <a href="attach_detach.html"><b>attach/detach</b></a>
+                </p>
+            </subsection>
+
+            <a name="dynamic"/>
+            <subsection name="Dynamic Fetch Groups">
+                <p>
+                    The mechanism above provides static fetch groups defined in XML or annotations. 
+                    That is great when you know in advance what fields you want to fetch. In some situations 
+                    you may want to define your fields to fetch at run time. This became standard in JDO2.2
+                    It operates as follows
+                </p>
+                <source>
+import org.datanucleus.FetchGroup;
+
+// Create a FetchGroup on the PMF called "TestGroup" for MyClass
+FetchGroup grp = myPMF.getFetchGroup("TestGroup", MyClass.class);
+grp.addMember("field1").addMember("field2");
+
+// Add this group to the fetch plan (using its name)
+fp.addGroup("TestGroup");</source>
+                <p>
+                    So we use the DataNucleus PMF as a way of creating a FetchGroup, and then register that 
+                    FetchGroup with the PMF for use by all PMs. We then enable our FetchGroup for use in the
+                    FetchPlan by using its group name (as we do for a static group). The FetchGroup allows you 
+                    to add/remove the fields necessary so you have full API control over the fields to be 
+                    fetched.
+                </p>
+                <br/>
+            </subsection>
+
+            <subsection name="Fetch Depth">
+                <p>
+                    The basic fetch group defines which fields are to be fetched. It doesn't explicitly define how far 
+                    down an object graph is to be fetched. JDO provides two ways of controlling this.
+                </p>
+                <p>
+                    The first is to set the <b>maxFetchDepth</b> for the <i>FetchPlan</i>. This value specifies how 
+                    far out from the root object the related objects will be fetched. A positive value means that 
+                    this number of relationships will be  traversed from the root object. A value of -1 means that 
+                    no limit will be placed on the fetching traversal. The default is 1. Let's take an example
+                </p>
+                <source><![CDATA[
+public class MyClass1
+{
+    MyClass2 field1;
+    ...
+}
+
+public class MyClass2
+{
+    MyClass3 field2;
+    ...
+}
+
+public class MyClass3
+{
+    MyClass4 field3;
+    ...
+}]]></source>
+                <p>
+                    and we want to detach <i>field1</i> of instances of <i>MyClass1</i>, down 2 levels - so detaching 
+                    the initial "field1" <i>MyClass2</i> object, and its "field2" <i>MyClass3</i> instance. So we 
+                    define our fetch-groups like this
+                </p>
+                <source><![CDATA[
+<class name="MyClass1">
+    ...
+    <fetch-group name="includingField1">
+        <field name="field1"/>
+    </fetch-group>
+</class>
+<class name="MyClass2">
+    ...
+    <fetch-group name="includingField2">
+        <field name="field2"/>
+    </fetch-group>
+</class>]]></source>
+                <p>
+                    and we then define the <b>maxFetchDepth</b> as 2, like this
+                </p>
+                <source>pm.getFetchPlan().setMaxFetchDepth(2);</source>
+                <p>
+                    A further refinement to this global fetch depth setting is to control the fetching of recursive 
+                    fields. This is performed via a MetaData setting "recursion-depth". A value of 1 means that only 
+                    1 level of objects will be fetched. A value of -1 means there is no limit on the amount of recursion. 
+                    The default is 1. Let's take an example
+                </p>
+                <source>
+public class Directory
+{
+    Collection children;
+    ...
+}</source>
+                <source><![CDATA[
+<class name="Directory">
+    <field name="children">
+        <collection element-type="Directory"/>
+    </field>
+
+    <fetch-group name="grandchildren">
+        <field name="children" recursion-depth="2"/>
+    </fetch-group>
+    ...
+</class>]]></source>
+                <p>
+                    So when we fetch a Directory, it will fetch 2 levels of the <i>children</i> field, hence fetching 
+                    the children and the grandchildren.
+                </p>
+            </subsection>
+
+            <subsection name="Fetch Size">
+                <p>
+                    A FetchPlan can also be used for defining the fetching policy when using queries. This can be 
+                    set using
+                </p>
+                <source>pm.getFetchPlan().setFetchSize(value);</source>
+                <p>
+                    The default is <i>FetchPlan.FETCH_SIZE_OPTIMAL</i> which leaves it to DataNucleus to optimise the fetching
+                    of instances. A positive value defines the number of instances to be fetched. Using 
+                    <i>FetchPlan.FETCH_SIZE_GREEDY</i> means that all instances will be fetched immediately.
+                </p>
+            </subsection>
+        </section>
+    </body>
+</document>



Mime
View raw message