Author: andyj Date: Tue Jan 15 06:29:01 2013 New Revision: 846705 Log: Maven2 site Added: websites/production/db/content/jdo/images/JDOx150.gif (with props) websites/production/db/content/jdo/images/logos/build-by-maven-black.png (with props) websites/production/db/content/jdo/images/logos/build-by-maven-white.png (with props) Modified: websites/production/db/content/jdo/attach_detach.html websites/production/db/content/jdo/class_types.html websites/production/db/content/jdo/dependencies.html websites/production/db/content/jdo/downloads.html websites/production/db/content/jdo/enhancement.html websites/production/db/content/jdo/exceptions.html websites/production/db/content/jdo/extents.html websites/production/db/content/jdo/faq.html websites/production/db/content/jdo/fetchgroups.html websites/production/db/content/jdo/field_types.html websites/production/db/content/jdo/get-involved.html websites/production/db/content/jdo/glossary.html websites/production/db/content/jdo/guides.html websites/production/db/content/jdo/guides/maven-jdo.html websites/production/db/content/jdo/guides/replication.html websites/production/db/content/jdo/images/logos/maven-feather.png websites/production/db/content/jdo/impls.html websites/production/db/content/jdo/index.html websites/production/db/content/jdo/issuetracking.html websites/production/db/content/jdo/javadoc.html websites/production/db/content/jdo/jdo_3_0_overview.html websites/production/db/content/jdo/jdo_dtd.html websites/production/db/content/jdo/jdo_v_jpa.html websites/production/db/content/jdo/jdo_v_jpa_api.html websites/production/db/content/jdo/jdo_v_jpa_orm.html websites/production/db/content/jdo/jdocentral.html websites/production/db/content/jdo/jdoconfig_dtd.html websites/production/db/content/jdo/jdohelper.html websites/production/db/content/jdo/jdoql.html websites/production/db/content/jdo/jdoql_methods.html websites/production/db/content/jdo/jdoql_result.html websites/production/db/content/jdo/jdoquery_dtd.html websites/production/db/content/jdo/mail-lists.html websites/production/db/content/jdo/metadata.html websites/production/db/content/jdo/newshistory.html websites/production/db/content/jdo/object_retrieval.html websites/production/db/content/jdo/orm_dtd.html websites/production/db/content/jdo/pm.html websites/production/db/content/jdo/pmf.html websites/production/db/content/jdo/references.html websites/production/db/content/jdo/releases/release-2.0-beta.cgi websites/production/db/content/jdo/releases/release-2.0-beta.html websites/production/db/content/jdo/releases/release-2.0-rc1.cgi websites/production/db/content/jdo/releases/release-2.0-rc1.html websites/production/db/content/jdo/releases/release-2.0.cgi websites/production/db/content/jdo/releases/release-2.0.html websites/production/db/content/jdo/releases/release-2.1.1.cgi websites/production/db/content/jdo/releases/release-2.1.1.html websites/production/db/content/jdo/releases/release-2.1.cgi websites/production/db/content/jdo/releases/release-2.1.html websites/production/db/content/jdo/releases/release-2.2.cgi websites/production/db/content/jdo/releases/release-2.2.html websites/production/db/content/jdo/releases/release-2.3-ea.cgi websites/production/db/content/jdo/releases/release-2.3-ea.html websites/production/db/content/jdo/releases/release-3.0.1.html websites/production/db/content/jdo/releases/release-3.0.cgi websites/production/db/content/jdo/releases/release-3.0.html websites/production/db/content/jdo/roadmap.html websites/production/db/content/jdo/specifications.html websites/production/db/content/jdo/state_transition.html websites/production/db/content/jdo/svn.html websites/production/db/content/jdo/tck.html websites/production/db/content/jdo/team-list.html websites/production/db/content/jdo/transactions.html websites/production/db/content/jdo/why_jdo.html Modified: websites/production/db/content/jdo/attach_detach.html ============================================================================== --- websites/production/db/content/jdo/attach_detach.html (original) +++ websites/production/db/content/jdo/attach_detach.html Tue Jan 15 06:29:01 2013 @@ -1,25 +1,232 @@ -Java Data Objects (JDO) - Attach/Detach

JDO Attach/Detach

+ + + + + + Maven - + Attach/Detach + + + + + + + +

+ +
+ +
+
+
+ + +

JDO Attach/Detach

+

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 detaching an object from the + JDO 2.0 introduces a new way of handling this situation, by detaching an object from the persistence graph, allowing it to be worked on in the users application. It can then be - attached to the persistence graph later. + attached to the persistence graph later. Please refer to Object Lifecycle for where this fits in. - The first thing to do to use a class with this facility is to tag it as "detachable". + 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

-
<class name="MyClass" detachable="true">
-

+

<class name="MyClass" detachable="true">
+

This acts as an instruction to the enhancement process to add methods necessary to utilise the attach/detach process. -

+

+ +

The following code fragment highlights how to use the attach/detach mechanism

-
+            
 Product working_product=null;
 Transaction tx=pm.currentTransaction();
 try
@@ -72,22 +279,23 @@ finally
         tx.rollback();
     }
 }
-

+

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 - attach/detach :- -

    + attach/detach :- +

    +
    • Calling detachCopy on an object that is not detachable will return a transient instance that is a COPY of the original, so use the COPY thereafter.
    • Calling detachCopy on an object that is detachable will return a detached instance that is a COPY of the original, so use this COPY thereafter
    • -
    • A detached object retain the id of its datastore entity. Detached objects should be used +
    • A detached 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 makeTransient instead of detachCopy.
    • -
    • Calling detachCopy will detach all fields of that object that are in the current - Fetch Group for that class for that PersistenceManager.
    • -
    • By default the fields of the object that will be detached are those in the Default Fetch Group.
    • + you should use makeTransient instead of detachCopy. +
    • Calling detachCopy will detach all fields of that object that are in the current + Fetch Group for that class for that PersistenceManager.
    • +
    • By default the fields of the object that will be detached are those in the Default Fetch Group.
    • You should choose your Fetch Group carefully, bearing in mind which object(s) you want to access whilst detached. Detaching a relation field will detach the related object as well.
    • @@ -95,21 +303,25 @@ finally the object is detached.
    • If you don't detach a field of an object, you can update the value for that field while detached, and thereafter you can access the value for that field.
    • -
    • Calling makePersistent will return an (attached) copy of the detached object. It will attach all fields that +
    • Calling makePersistent 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.
    • -

    Detach All On Commit

    +

+ + +

Detach All On Commit

+

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 PersistenceManagers (PMs) from a - PersistenceManagerFactory (PMF) you could either set the PMF property - "datanucleus.DetachAllOnCommit", or you could create your PMF and call the PMF method - setDetachAllOnCommit(true). If instead you wanted to use this mode only for a particular + If you want to use this mode globally for all PersistenceManagers (PMs) from a + PersistenceManagerFactory (PMF) you could either set the PMF property + "datanucleus.DetachAllOnCommit", or you could create your PMF and call the PMF method + setDetachAllOnCommit(true). 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 - setDetachAllOnCommit(true) before the commit of the transaction, and it will apply for all - transaction commits thereafter, until turned off (setDetachAllOnCommit(false). + setDetachAllOnCommit(true) before the commit of the transaction, and it will apply for all + transaction commits thereafter, until turned off (setDetachAllOnCommit(false). Here's an example

-
+                
 // Create a PMF
 ...
 
@@ -129,7 +341,7 @@ try
     pm.makePersistent(my);
 
     tx.commit();
-    // The object "my" is now in detached state and can be used further
+    // The object "my" is now in detached state and can be used further
 }
 finally
 {
@@ -138,18 +350,24 @@ finally
         tx.rollback();
     }
 }
-

Copy On Attach

+
+

+ + +

Copy On Attach

+

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. -

- You enable this by setting the PersistenceManagerFactory (PMF) property - datanucleus.CopyOnAttach to false. Alternatively you can use the methods +

+

+ You enable this by setting the PersistenceManagerFactory (PMF) property + datanucleus.CopyOnAttach to false. Alternatively you can use the methods PersistenceManagerFactory.setCopyOnAttach(boolean flag) or PersistenceManager.setCopyOnAttach(boolean flag). If we return to the example at the start of this page, this now becomes

-
+                
 // Reattach the updated object
 pm.setCopyOnAttach(false);
 tx = pm.currentTransaction();
@@ -175,33 +393,60 @@ finally
         tx.rollback();
     }
 }
-

+

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. -



Serialization of Detachable classes

+

+
+
+ +

Serialization of Detachable classes

+

During enhancement of Detachable classes, a field called jdoDetachedState is added to the class definition. This field allows reading and changing tracking of detached objects while they are not managed by a PersistenceManager. -

+

+

When serialization occurs on a Detachable object, the jdoDetachedState 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. -

+

+

Serialization and deserialization of Detachable classes and un-enhanced versions of the same class is only possible if the field serialVersionUID is added. It's recommended during development of the class, to define the serialVersionUID and make the class to implement the java.io.Serializable interface, as the following example:

-
+
 class MyClass implements java.io.Serializable
 {
     private static final long serialVersionUID = 2765740961462495537L; // any random value here
     
     //.... other fields
 }
-
-


\ No newline at end of file +
+
+
+
+ + + +
+
+
+
+
+ + + Modified: websites/production/db/content/jdo/class_types.html ============================================================================== --- websites/production/db/content/jdo/class_types.html (original) +++ websites/production/db/content/jdo/class_types.html Tue Jan 15 06:29:01 2013 @@ -1,48 +1,281 @@ -Java Data Objects (JDO) - JDO Class Types

JDO Class Types

+ + + + + + Maven - + JDO Class Types + + + + + + + +

+ +
+ +
+
+
+ + +

JDO Class Types

+

JDO provides a means of transparent persistence of objects of user defined classes. With JDO there are actually 3 types of classes. -

    -
  • Persistence Capable 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 enhanced +

    +
      +
    • Persistence Capable 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 enhanced according to a JDO Meta-Data specification before use within a JDO environment.
    • -
    • Persistence Aware classes are classes that manipulate Persistence Capable instances through direct attribute +
    • Persistence Aware 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.
    • -
    • Normal classes are classes that aren't themselves persistable, and have no knowledge of persistence either. +
    • Normal 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.
    • -

    PersistenceCapable

    +

+ +

PersistenceCapable

+

Classes are defined as PersistenceCapable either by XML MetaData, like this

-
-<class name="MyClass">
+                
+<class name="MyClass">
     ...
 </class>
-

+

or, in JDO2.1, using Annotations. Like this

-
+                
 @PersistenceCapable
 public class MyClass
 {
     ...
 }
-

PersistenceAware

+
+

+ +

PersistenceAware

+

Classes are defined as PersistenceAware either by XML MetaData, like this

-
-<class name="MyClass" persistence-modifier="persistence-aware"/>
-

+

+<class name="MyClass" persistence-modifier="persistence-aware"/>
+

or, in JDO2.1, using Annotations. Like this

-
+                
 @PersistenceAware
 public class MyClass
 {
     ...
 }
-


\ No newline at end of file +
+
+
+ + + +
+
+
+
+
+ + + Modified: websites/production/db/content/jdo/dependencies.html ============================================================================== --- websites/production/db/content/jdo/dependencies.html (original) +++ websites/production/db/content/jdo/dependencies.html Tue Jan 15 06:29:01 2013 @@ -1,18 +1,239 @@ -Java Data Objects (JDO) - Project Dependencies

The Apache JDO Project

-Apache JDO is a sub-project of the Apache DB TLP. It includes two major areas: -

The common external dependencies of JDO include the tools used to build and test it: @@ -30,18 +251,19 @@ The Reference Implementation is being de

    -
  • JDO 2.0 API
  • +
  • JDO 2.0 API
    • Java Transaction API
    -
  • JDO 2.0 TCK
  • + +
  • JDO 2.0 TCK
    • Java Transaction API
    • Jakarta Commons Logging
    • Log4j
    • Apache Derby
    • Spring Framework Core
    • -
    • JPOX
    • +
    • JPOX
      • ASM
      • Source Forge c3p0
      • @@ -49,10 +271,28 @@ The Reference Implementation is being de
      • Commons Pool
      • Commons Collections
      +
    +
+
-


\ No newline at end of file + +
+
+
+
+
+ + + Modified: websites/production/db/content/jdo/downloads.html ============================================================================== --- websites/production/db/content/jdo/downloads.html (original) +++ websites/production/db/content/jdo/downloads.html Tue Jan 15 06:29:01 2013 @@ -1,36 +1,278 @@ -Java Data Objects (JDO) - Downloads

Latest Official Release

+ + + + + + Maven - + Downloads + + + + + + + + +

+ +
+ +
+
+
+ + +

Latest Official Release

+

JDO 3.0.1 - + November 13, 2011 -

Previous Official Releases

+

+
+ +

Previous Official Releases

+

JDO 3.0 - + July 23, 2010 -

+

+

JDO 2.2 - + October 24, 2008 -

+

+

JDO 2.1.1 - + August 29, 2008 -

+

+

JDO 2.1 - + March 17, 2008 -

+

+

JDO 2.0 - + May 1, 2006 -

About JDO Releases

+

+ +
+ +

About JDO Releases

+

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. -

    +

    +
    • The api project contains source to build jdo-api.jar. The jar file is the only artifact needed for users who wish to compile @@ -49,19 +291,39 @@ The source distribution is the only artifact needed to be downloaded by the user.
    • -
    -

    +

+

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. -

+

+

For information on running the TCK, see TCK. If downloading multiple source packages, extract them all into the same directory. This will preserve the source dependencies among the projects. -

+

+

See Source Code Version Control for information about downloading the latest source code for all of the JDO projects. -


\ No newline at end of file +

+
+ + +
+
+
+
+
+ + +