Modified: websites/production/db/content/jdo/enhancement.html ============================================================================== --- websites/production/db/content/jdo/enhancement.html (original) +++ websites/production/db/content/jdo/enhancement.html Tue Jan 15 06:29:01 2013 @@ -1,15 +1,221 @@ -Java Data Objects (JDO) - JDO Enhancement

JDO Enhancement

+ + + + + + Maven - + JDO Enhancement + + + + + + + +

+ +
+ +
+
+
+ + +

JDO Enhancement

+

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 + Before a class is used at runtime it is compiled and then "enhanced" to implement the interface PersistenceCapable, and optionally also Detachable. -

+

+

We can demonstrate this by taking a sample class, and seeing it before and after enhancement. We start with the following class

-
+            
 package org.apache.jdo.test;
 
 public class A
@@ -50,16 +256,16 @@ public class A
 
     public String toString()
     {
-        return "A : id=" + id + " [" + name + "] b=\"" + b + "\"";
+        return "A : id=" + id + " [" + name + "] b=\"" + b + "\"";
     }
 }
-

+

and require it to be PersistenceCapable and Detachable. The enhancement process needs to intercept all updates of the fields of the class (id, name, b) as well as add on the necessary PersistenceCapable, Detachable methods. - After "enhancement" it becomes + After "enhancement" it becomes

-
+            
 package org.apache.jdo.test;
 import java.util.BitSet;
 
@@ -93,7 +299,7 @@ public class A implements PersistenceCap
         jdoFieldFlags = __jdoFieldFlagsInit();
         jdoInheritedFieldCount = __jdoGetInheritedFieldCount();
         jdoPersistenceCapableSuperclass = __jdoPersistenceCapableSuperclassInit();
-        JDOImplHelper.registerClass(___jdo$loadClass("org.apache.jdo.test.A"),
+        JDOImplHelper.registerClass(___jdo$loadClass("org.apache.jdo.test.A"),
                     jdoFieldNames, jdoFieldTypes,
                     jdoFieldFlags,
                     jdoPersistenceCapableSuperclass, new A());
@@ -126,20 +332,20 @@ public class A implements PersistenceCap
     
     public String toString()
     {
-        return new StringBuilder().append("A : id=").append(jdoGetid(this))
-           .append(" [").append(jdoGetname(this))
-           .append("] b=\"").append(jdoGetb(this))
-           .append("\"").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");
+              ("ObjectIdFieldConsumer is null");
         if (!(oid instanceof LongIdentity))
             throw new ClassCastException
-              ("oid is not instanceof javax.jdo.identity.LongIdentity");
+              ("oid is not instanceof javax.jdo.identity.LongIdentity");
         LongIdentity o = (LongIdentity) oid;
         fc.storeLongField(1, o.getKey());
     }
@@ -148,7 +354,7 @@ public class A implements PersistenceCap
     {
         if (!(oid instanceof LongIdentity))
             throw new ClassCastException
-              ("key class is not javax.jdo.identity.LongIdentity or null");
+              ("key class is not javax.jdo.identity.LongIdentity or null");
         LongIdentity o = (LongIdentity) oid;
         id = o.getKey();
     }
@@ -156,13 +362,13 @@ public class A implements PersistenceCap
     public final void jdoCopyKeyFieldsToObjectId(Object oid)
     {
         throw new JDOFatalInternalException
-          ("It's illegal to call jdoCopyKeyFieldsToObjectId for a class with Single Field Identity.");
+          ("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.");
+          ("It's illegal to call jdoCopyKeyFieldsToObjectId for a class with Single Field Identity.");
     }
     
     public final Object jdoGetObjectId()
@@ -256,7 +462,7 @@ public class A implements PersistenceCap
     public final Object jdoNewObjectIdInstance(Object key) 
     {
         if (key == null)
-            throw new IllegalArgumentException("key is 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);
@@ -265,7 +471,7 @@ public class A implements PersistenceCap
     public final void jdoProvideFields(int[] fieldId)
     {
         if (fieldId == null)
-            throw new IllegalArgumentException("argment is null");
+            throw new IllegalArgumentException("argment is null");
         int i = fieldId.length - 1;
         if (i >= 0)
         {
@@ -278,7 +484,7 @@ public class A implements PersistenceCap
     public final void jdoReplaceFields(int[] fieldId) 
     {
         if (fieldId == null)
-            throw new IllegalArgumentException("argument is null");
+            throw new IllegalArgumentException("argument is null");
         int i = fieldId.length;
         if (i > 0)
         {
@@ -316,7 +522,7 @@ public class A implements PersistenceCap
     public final synchronized void jdoReplaceDetachedState()
     {
         if (jdoStateManager == null)
-            throw new IllegalStateException("state manager is null");
+            throw new IllegalStateException("state manager is null");
         A a = this;
         a.jdoDetachedState = a.jdoStateManager.replacingDetachedState(this, jdoDetachedState);
     }
@@ -343,7 +549,7 @@ public class A implements PersistenceCap
     public void jdoReplaceField(int fieldIndex)
     {
         if (jdoStateManager == null)
-            throw new IllegalStateException("state manager is null");
+            throw new IllegalStateException("state manager is null");
         switch (fieldIndex)
         {
             case 0:
@@ -365,14 +571,14 @@ public class A implements PersistenceCap
                 break;
             }
             default:
-                throw new IllegalArgumentException("out of field index :" + fieldIndex);
+                throw new IllegalArgumentException("out of field index :" + fieldIndex);
         }
     }
     
     public void jdoProvideField(int fieldIndex)
     {
         if (jdoStateManager == null)
-            throw new IllegalStateException("state manager is null");
+            throw new IllegalStateException("state manager is null");
         switch (fieldIndex)
         {
             case 0:
@@ -385,7 +591,7 @@ public class A implements PersistenceCap
                 jdoStateManager.providedStringField(this, fieldIndex, name);
                 break;
             default:
-                throw new IllegalArgumentException("out of field index :" + fieldIndex);
+                throw new IllegalArgumentException("out of field index :" + fieldIndex);
          }
     }
     
@@ -403,21 +609,21 @@ public class A implements PersistenceCap
                 name = obj.name;
                 break;
             default:
-                throw new IllegalArgumentException("out of field index :" + index);
+                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");
+            throw new IllegalStateException("state manager is null");
         if (fieldNumbers == null)
-            throw new IllegalStateException("fieldNumbers is null");
+            throw new IllegalStateException("fieldNumbers is null");
         if (obj instanceof A != true)
-            throw new IllegalArgumentException("object is not org.apache.jdo.test.A");
+            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");
+            throw new IllegalArgumentException("state manager unmatch");
         int i = fieldNumbers.length - 1;
         if (i >= 0)
         {
@@ -429,13 +635,13 @@ public class A implements PersistenceCap
     
     private static final String[] __jdoFieldNamesInit()
     {
-        return new String[] { "b", "id", "name" };
+        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") };
+        return new Class[] { ___jdo$loadClass("org.apache.jdo.test.B"), Long.TYPE,
+                 ___jdo$loadClass("java.lang.String") };
     }
     
     private static final byte[] __jdoFieldFlagsInit()
@@ -503,8 +709,8 @@ public class A implements PersistenceCap
         && ((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.");
+              ("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;
     }
     
@@ -536,8 +742,8 @@ public class A implements PersistenceCap
             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.");
+              ("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;
     }
 
@@ -546,6 +752,24 @@ public class A implements PersistenceCap
         jdoSetname(this, name);
     }
 }
-

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

JDO Exceptions

+ + + + + + Maven - + JDO Exceptions + + + + + + + +

+ +
+ +
+
+
+ + +

JDO Exceptions

+

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 unchecked exceptions is that JDO tries to provide transparent + the exceptions or not. The reason for JDO using unchecked 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. -

JDOException

+

+ +

JDOException

+

This is the base class for all JDO exceptions. It is a subclass of RuntimeException, and need not be declared or caught. -



Can Retry Exceptions

- JDO Can Retry Exceptions -
+ + + + + +
ExceptionDescription
JDOCanRetryExceptionThis is the base class for errors that can be retried.
JDOUserExceptionThis is the base class for user errors that can be retried.
JDODataStoreExceptionThis is the base class for datastore errors that can be retried. - Any root SQLException that caused this will typically be nested within this exception.
JDOObjectNotFoundExceptionThis exception is to notify the application that an object does not exist in the +

+
+ + +

Can Retry Exceptions

+
+ JDO Can Retry Exceptions +
+ + + + + + + + + + + + + + + + + + +
ExceptionDescription
JDOCanRetryExceptionThis is the base class for errors that can be retried.
JDOUserExceptionThis is the base class for user errors that can be retried.
JDODataStoreExceptionThis is the base class for datastore errors that can be retried. + Any root SQLException that caused this will typically be nested within this exception.
JDOObjectNotFoundExceptionThis 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.
JDOUnsupportedOptionExceptionThis exception is thrown by an implementation to indicate that it does not implement a - JDO optional feature.


Fatal Exceptions

- JDO Fatal Exceptions -
+ + + + + +
ExceptionDescription
JDOFatalExceptionThis is the base class for errors that cannot be retried. This exception generally + thrown during commit, then the transaction is rolled back.
JDOUnsupportedOptionExceptionThis exception is thrown by an implementation to indicate that it does not implement a + JDO optional feature.
+
+
+ +

Fatal Exceptions

+
+ JDO Fatal Exceptions +
+ + + + + + + + + + + + + + + + + + + + + + +
ExceptionDescription
JDOFatalExceptionThis 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.
JDOFatalUserExceptionThis is the base class for user errors that cannot be retried.
JDOFatalInternalExceptionThis is the base class for JDO implementation failures.
JDOFatalDataStoreExceptionThis is the base class for fatal datastore errors. When this exception is thrown, the + and the transaction should be abandoned.
JDOFatalUserExceptionThis is the base class for user errors that cannot be retried.
JDOFatalInternalExceptionThis is the base class for JDO implementation failures.
JDOFatalDataStoreExceptionThis 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.
JDOOptimisticVerificationExceptionThis exception is the result of a user commit operation in an optimistic transaction + within this exception.
JDOOptimisticVerificationExceptionThis 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.
JDODetachedFieldAccessExceptionThis exception is the result of a user accessing a field of a detached instance, where - the field was not copied to the detached instance.

\ No newline at end of file + The user will never see this exception except as a result of commit.
JDODetachedFieldAccessExceptionThis exception is the result of a user accessing a field of a detached instance, where + the field was not copied to the detached instance.
+
+
+ + +
+
+
+
+
+ + + Modified: websites/production/db/content/jdo/extents.html ============================================================================== --- websites/production/db/content/jdo/extents.html (original) +++ websites/production/db/content/jdo/extents.html Tue Jan 15 06:29:01 2013 @@ -1,20 +1,244 @@ -Java Data Objects (JDO) - JDO Extents

JDO Extents

- JDO implementations manage the persistence of objects into the datastore. An Extent + + + + + + Maven - + JDO Extents + + + + + + + +

+ +
+ +
+
+
+ + +

JDO Extents

+

+ JDO implementations manage the persistence of objects into the datastore. An Extent 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

-
+            
 Extent e = pm.getExtent(MyClass.class, true);
             
-

- This example will return an Extent that contains all persisted instances of the class MyClass +

+ This example will return an Extent that contains all persisted instances of the class MyClass 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). -


\ No newline at end of file +

+
+ + + +
+
+
+
+
+ + + Modified: websites/production/db/content/jdo/faq.html ============================================================================== --- websites/production/db/content/jdo/faq.html (original) +++ websites/production/db/content/jdo/faq.html Tue Jan 15 06:29:01 2013 @@ -1,17 +1,238 @@ -Java Data Objects (JDO) - FAQ

General

- What is JDO? -

+ + + + + + Maven - + FAQ + + + + + + + + + + +
+ +
+
+
+ + + +

General

+ +

+ What is JDO? + JDO is Java Data Objects, a datastore-agnostic interface for storing Java objects in transactional datastores. -

-

- I'd like to find out more about the project and - possibly contribute. What do I do next? - -

Participation on the project is via the mailing + +

+ +

+ I'd like to find out more about the project and possibly contribute. What do I do next? + 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, @@ -20,27 +241,47 @@ 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! -

-

- Where is the mailing list, and how can I - subscribe? - -

+ +

+ +

+ Where is the mailing list, and how can I subscribe? + The developers mailing list is jdo-dev@db.apache.org, a high-volume list currently receiving from 100 to 300 messages a month. -

+
The users mailing list is jdo-user@db.apache.org. -

-

- Does this project use a wiki? - -

+ +

+ +

+ Does this project use a wiki? + It does - the - JDO wiki + JDO wiki complements the work taking place on the mailing list and provides additional information on the project. -

-


\ No newline at end of file + +

+
+ + + +
+
+
+
+
+ + +