openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwsut...@apache.org
Subject svn commit: r447584 [6/8] - in /incubator/openjpa/sandboxes/OPENJPA-24: ./ openjpa-all/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-jdbc/src/main/java/org/apache/openjpa/jd...
Date Mon, 18 Sep 2006 21:58:05 GMT
Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java Mon Sep 18 14:57:52 2006
@@ -299,6 +299,10 @@
          * Throw proper exception if given value is a collection/map/array.
          */
         protected void assertNotContainer(Value val, StoreQuery q) {
+            // variables represent container elements, not the container itself
+            if (val.isVariable())
+                return;
+
             Class type;
             if (val instanceof Path) {
                 FieldMetaData fmd = ((Path) val).last();
@@ -628,8 +632,8 @@
         private final ExpressionParser _parser;
         private final ExpressionFactory[] _facts;
         private final QueryExpressions[] _exps;
+        private final Class[] _projTypes;
         private Value[] _inMemOrdering;
-        private Class[] _projTypes;
 
         public DataStoreExecutor(ExpressionStoreQuery q,
             ClassMetaData meta, boolean subclasses,
@@ -644,10 +648,17 @@
                 _facts[i] = q.getExpressionFactory(_metas[i]);
 
             _exps = new QueryExpressions[_metas.length];
-            for (int i = 0; i < _exps.length; i++) {
+            for (int i = 0; i < _exps.length; i++)
                 _exps[i] = parser.eval(parsed, q, _facts[i], _metas[i]);
-                for (int j = 0; j < _exps[i].projections.length; j++)
-                    assertNotContainer(_exps[i].projections[j], q);
+
+            if (_exps[0].projections.length == 0)
+                _projTypes = StoreQuery.EMPTY_CLASSES;
+            else {
+                _projTypes = new Class[_exps[0].projections.length];
+                for (int i = 0; i < _exps[0].projections.length; i++) {
+                    assertNotContainer(_exps[0].projections[i], q);
+                    _projTypes[i] = _exps[0].projections[i].getType();
+                }
             }
         }
 
@@ -706,29 +717,16 @@
                     _inMemOrdering = _parser.eval(_exps[0].orderingClauses,
                         (ExpressionStoreQuery) q, factory, _meta);
                 }
-
-                // use the parsed ordering expression to extract the ordering
-                // value
-                Val val = (Val) _inMemOrdering[orderIndex];
-                return val.evaluate(resultObject, resultObject,
-                    q.getContext().getStoreContext(), params);
             }
+
+            // use the parsed ordering expression to extract the ordering value
+            Val val = (Val) _inMemOrdering[orderIndex];
+            return val.evaluate(resultObject, resultObject,
+                q.getContext().getStoreContext(), params);
         }
 
         public Class[] getProjectionTypes(StoreQuery q) {
-            if (_exps[0].projections.length == 0)
-                return StoreQuery.EMPTY_CLASSES;
-
-            synchronized (this) {
-                if (_projTypes == null) {
-                    // delay creating this array until it is requested b/c
-                    // before execution the types might not be initialized
-                    _projTypes = new Class[_exps[0].projections.length];
-                    for (int i = 0; i < _exps[0].projections.length; i++)
-                        _projTypes[i] = _exps[0].projections[i].getType();
-				}
-				return _projTypes;
-			}
+            return _projTypes;
 		}
 	}
 }

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExtentImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExtentImpl.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExtentImpl.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExtentImpl.java Mon Sep 18 14:57:52 2006
@@ -120,10 +120,11 @@
                 _broker.getClassLoader(), false);
 
             ClassMetaData[] metas;
-            if (meta != null && (meta.isMapped() || (_subs
+            if (meta != null && (!_subs || !meta.isManagedInterface())
+                && (meta.isMapped() || (_subs
                 && meta.getMappedPCSubclassMetaDatas().length > 0)))
                 metas = new ClassMetaData[]{ meta };
-            else if (meta == null && _subs)
+            else if (_subs && (meta == null || meta.isManagedInterface()))
                 metas = repos.getImplementorMetaDatas(_type,
                     _broker.getClassLoader(), false);
             else

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/HollowState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/HollowState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/HollowState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/HollowState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents a hollow instance that exists in the data store, but whose
+ * Represents a hollow instance that exists in the data store, but whose
  * state has not been loaded and who is not active in the current transaction
  * (if any). This may be the state of instances returned on ID lookups or by
  * traversing relations, and the state of persistent instances outside of

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PCleanState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PCleanState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PCleanState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PCleanState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents a persistent instance that is participating in the current
+ * Represents a persistent instance that is participating in the current
  * transaction, but has not yet been modified.
  *
  * @author Abe White

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedFlushedState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedFlushedState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedFlushedState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedFlushedState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents a persistent instance that has been deleted in the current
+ * Represents a persistent instance that has been deleted in the current
  * transaction, and that has been flushed to the database.
  *
  * @author Patrick Linskey

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDeletedState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents a persistent instance that has been deleted in the current
+ * Represents a persistent instance that has been deleted in the current
  * transaction.
  *
  * @author Abe White

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDirtyState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDirtyState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDirtyState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PDirtyState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents a persistent instance that is participating in the current
+ * Represents a persistent instance that is participating in the current
  * transaction, and has been modified.
  *
  * @author Abe White

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewDeletedState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents an instance that was made persistent, then deleted within the
+ * Represents an instance that was made persistent, then deleted within the
  * current	transaction.
  *
  * @author Abe White

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedFlushedState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedFlushedState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedFlushedState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedFlushedState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents an instance that was made persistent within the
+ * Represents an instance that was made persistent within the
  * current	transaction, flushed, deleted, and flushed.
  *
  * @author Patrick Linskey

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewFlushedDeletedState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents an instance that was made persistent within the
+ * Represents an instance that was made persistent within the
  * current	transaction, flushed, and subsequently deleted.
  *
  * @author Patrick Linskey

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNewState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents an instance that was made persistent within the
+ * Represents an instance that was made persistent within the
  * current	transaction.
  *
  * @author Abe White

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransDeletedState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransDeletedState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransDeletedState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransDeletedState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents an instance that was deleted outside a transaction.
+ * Represents an instance that was deleted outside a transaction.
  *
  * @author Steve Kim
  */

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransDirtyState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransDirtyState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransDirtyState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransDirtyState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents a persistent instance that has been dirtied outside of
+ * Represents a persistent instance that has been dirtied outside of
  * transaction. This state is only reachable only if the
  * RetainNontransactional property is set.
  *

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransNewState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransNewState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransNewState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransNewState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents an instance that was persisted outside a transaction.
+ * Represents an instance that was persisted outside a transaction.
  *
  * @author Steve Kim
  */

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransState.java Mon Sep 18 14:57:52 2006
@@ -21,7 +21,7 @@
 
 /**
  * Lifecycle state.
- *  Represents a persistent instance that is not transactional, but that
+ * Represents a persistent instance that is not transactional, but that
  * allows access to persistent data. This state is reachable only if the
  * RetainState property is set.
  *

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java Mon Sep 18 14:57:52 2006
@@ -657,11 +657,11 @@
         ClassMetaData[] metas;
         if (_class == null || _storeQuery.supportsAbstractExecutors())
             metas = new ClassMetaData[]{ meta };
-        else if (meta != null && (_subclasses || meta.isMapped()))
-            metas = new ClassMetaData[]{ meta };
-        else if (_subclasses)
+        else if (_subclasses && (meta == null || meta.isManagedInterface()))
             metas = repos.getImplementorMetaDatas(_class,
                 _broker.getClassLoader(), true);
+        else if (meta != null && (_subclasses || meta.isMapped()))
+            metas = new ClassMetaData[]{ meta };
         else
             metas = StoreQuery.EMPTY_METAS;
 

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java Mon Sep 18 14:57:52 2006
@@ -76,8 +76,8 @@
                 if (proxy == null) {
                     proxy = (Proxy) _sm.newFieldProxy(field);
                     ((Date) proxy).setTime(((Date) objval).getTime());
-                    if (proxy instanceof Timestamp &&
-                        objval instanceof Timestamp)
+                    if (proxy instanceof Timestamp 
+                        && objval instanceof Timestamp)
                         ((Timestamp) proxy).setNanos(((Timestamp) objval).
                             getNanos());
                     ret = true;
@@ -89,12 +89,7 @@
                 proxy = checkProxy();
                 if (proxy == null) {
                     proxy = (Proxy) _sm.newFieldProxy(field);
-                    if (objval != null) {
-                        Calendar pcal = (Calendar) proxy;
-                        Calendar ocal = (Calendar) objval;
-                        pcal.setTime(ocal.getTime());
-                        pcal.setTimeZone(ocal.getTimeZone());
-                    }
+                    ((Calendar) proxy).setTime(((Calendar) objval).getTime());
                     ret = true;
                 }
                 break;

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java Mon Sep 18 14:57:52 2006
@@ -38,6 +38,7 @@
 import org.apache.openjpa.meta.ValueStrategies;
 import org.apache.openjpa.util.ApplicationIds;
 import org.apache.openjpa.util.Exceptions;
+import org.apache.openjpa.util.ImplHelper;
 import org.apache.openjpa.util.InternalException;
 import org.apache.openjpa.util.InvalidStateException;
 import org.apache.openjpa.util.ObjectNotFoundException;
@@ -823,8 +824,7 @@
         if (field != -1 && _meta.getField(field).isPrimaryKey())
             return;
 
-        boolean active = _broker.isActive();
-        if (active) {
+        if (_broker.isActive() && !_broker.isTransactionEnding()) {
             if (_broker.getOptimistic())
                 setPCState(_state.beforeOptimisticRead(this, field));
             else
@@ -2927,7 +2927,23 @@
      * Returns whether this instance needs a version check.
      */
     public boolean isVersionCheckRequired() {
-        return (_flags & FLAG_VERSION_CHECK) > 0;
+
+        // explicit flag for version check
+        if ((_flags & FLAG_VERSION_CHECK) > 0)
+            return true;
+
+        // need to check version if we have any dirty fields, unless we
+        // are in a datastore transaction
+        if (ImplHelper.getUpdateFields(this) != null) {
+            if (_broker.getOptimistic()) {
+                return true;
+            } else {
+                return _broker.getConfiguration().
+                    getCompatibilityInstance().getNonOptimisticVersionCheck();
+            }
+        }
+
+        return false;
     }
 
     /**

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TCleanState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TCleanState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TCleanState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TCleanState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents a transient instance that is managed by a StateManager and
+ * Represents a transient instance that is managed by a StateManager and
  * may be participating in the current	transaction, but has not yet been
  * modified.
  *

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TDirtyState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TDirtyState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TDirtyState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TDirtyState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents a transient instance that is participating in the current
+ * Represents a transient instance that is participating in the current
  * transaction, and has been modified.
  *
  * @author Abe White

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TLoadedState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TLoadedState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TLoadedState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TLoadedState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents a temporarily managed transient instance whose fields
+ * Represents a temporarily managed transient instance whose fields
  * are loaded for the purpose of field inspection such
  * as for cascades. This state should be released as soon as inspection
  * is complete.

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TransientState.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TransientState.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TransientState.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TransientState.java Mon Sep 18 14:57:52 2006
@@ -17,7 +17,7 @@
 
 /**
  * Lifecycle state.
- *  Represents a transient instance; this state lasts only through
+ * Represents a transient instance; this state lasts only through
  * the {@link #initialize} method, which immediately removes the
  * persistence capable instance from management by the OpenJPA runtime.
  *

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.java Mon Sep 18 14:57:52 2006
@@ -1358,7 +1358,7 @@
         // determind how to evauate a variabe
         if (!val.isVariable())
             return val;
-        else if (handleVar == VAR_PATH)
+        else if (handleVar == VAR_PATH && !(val instanceof Path))
             return newPath(val, val.getMetaData());
         else if (handleVar == VAR_ERROR)
             throw parseException(EX_USER, "unexpected-var",

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/ParseException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/ParseException.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/ParseException.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/ParseException.java Mon Sep 18 14:57:52 2006
@@ -24,7 +24,7 @@
 /**
  * Signifies that a lexical error occurred when parsing the JPQL statement.
  *
- * @author <a href="mailto:mprudhom@bea.com">Marc Prud'hommeaux</a>
+ * @author Marc Prud'hommeaux
  */
 public class ParseException
     extends UserException {

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataDefaults.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataDefaults.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataDefaults.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataDefaults.java Mon Sep 18 14:57:52 2006
@@ -40,6 +40,7 @@
         (AbstractMetaDataDefaults.class);
 
     private int _access = ClassMetaData.ACCESS_FIELD;
+    private int _identity = ClassMetaData.ID_UNKNOWN;
     private boolean _ignore = true;
     private boolean _interface = true;
     private boolean _pcRegistry = true;
@@ -63,18 +64,34 @@
 
     /**
      * The default access type for base classes with ACCESS_UNKNOWN.
-     * Returns ACCESS_FIELD by default.
+     * ACCESS_FIELD by default.
+     */
+    public int getDefaultAccessType() {
+        return _access;
+    }
+
+    /**
+     * The default access type for base classes with ACCESS_UNKNOWN.
+     * ACCESS_FIELD by default.
      */
     public void setDefaultAccessType(int access) {
         _access = access;
     }
 
     /**
-     * The default access type for base classes with ACCESS_UNKNOWN.
-     * Returns ACCESS_FIELD by default.
+     * The default identity type for unmapped classes without primary 
+     * key fields. ID_UNKNOWN by default.
      */
-    public int getDefaultAccessType() {
-        return _access;
+    public int getDefaultIdentityType() {
+        return _identity;
+    }
+
+    /**
+     * The default identity type for unmapped classes without primary 
+     * key fields. ID_UNKNOWN by default.
+     */
+    public void setDefaultIdentityType(int identity) {
+        _identity = identity;
     }
 
     public int getCallbackMode() {

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java Mon Sep 18 14:57:52 2006
@@ -142,7 +142,9 @@
     private Boolean _embedded = null;
     private Boolean _interface = null;
     private Class _impl = null;
-    private int _identity = -1;
+    private List _interfaces = null;
+    private Map _ifaceMap = new HashMap();
+    private int _identity = ID_UNKNOWN;
     private int _idStrategy = ValueStrategies.NONE;
     private int _accessType = ACCESS_UNKNOWN;
 
@@ -374,23 +376,17 @@
      * primary key fields, and {@link #ID_APPLICATION} otherwise.
      */
     public int getIdentityType() {
-        switch (_identity) {
-            case -1:
-                ClassMetaData sup = getPCSuperclassMetaData();
-                if (sup != null && sup.getIdentityType() != ID_UNKNOWN)
-                    _identity = sup.getIdentityType();
-                else {
-                    FieldMetaData[] pks = getPrimaryKeyFields();
-                    if (pks.length > 0)
-                        _identity = ID_APPLICATION;
-                    else
-                        _identity = ID_DATASTORE;
-                }
-                break;
-            case ID_UNKNOWN:
-                if (getPrimaryKeyFields().length > 0)
-                    _identity = ID_APPLICATION;
-                break;
+        if (_identity == ID_UNKNOWN) {
+            ClassMetaData sup = getPCSuperclassMetaData();
+            if (sup != null && sup.getIdentityType() != ID_UNKNOWN)
+                _identity = sup.getIdentityType();
+            else if (getPrimaryKeyFields().length > 0)
+                _identity = ID_APPLICATION;
+            else if (isMapped())
+                _identity = ID_DATASTORE;
+            else
+                _identity = _repos.getMetaDataFactory().getDefaults().
+                    getDefaultIdentityType();
         }
         return _identity;
     }
@@ -701,6 +697,81 @@
     public void setInterfaceImpl(Class impl) {
         _impl = impl;
     }
+
+    /**
+     * Return all explicitly declared interfaces this class implements.
+     */
+    public Class[] getDeclaredInterfaces() {
+        if (_interfaces == null)
+            return _repos.EMPTY_CLASSES;
+
+        return (Class[]) _interfaces.toArray(new Class[_interfaces.size()]);
+    }
+
+    /**
+     * Explicitly declare the given interface among the ones this
+     * class implements.
+     */
+    public void addDeclaredInterface(Class iface) {
+        if (_interfaces == null)
+            _interfaces = new ArrayList();
+        if (!iface.isInterface())
+            throw new MetaDataException(_loc.get("declare-non-interface",
+                this, iface));
+        _interfaces.add(iface);
+    }
+
+    /**
+     * Remove the given interface from the declared list.
+     */
+    public boolean removeDeclaredInterface(Class iface) {
+        if (_interfaces == null)
+            return false;
+        return _interfaces.remove(iface);
+    }
+
+    /**
+     * Alias properties from the given interface during  queries to
+     * the local field.
+     */
+    public void setInterfacePropertyAlias(Class iface, String orig, 
+        String local) {
+        synchronized (_ifaceMap) {
+            Map fields = (Map) _ifaceMap.get(iface);
+            if (fields == null) {
+                fields = new HashMap();
+                _ifaceMap.put(iface, fields);
+            }
+            if (fields.containsKey(orig))
+                throw new MetaDataException(_loc.get("duplicate-iface-alias", 
+                    this, orig, local));
+            fields.put(orig, local);
+        }
+    }
+    
+    /**
+     * Get local field alias for the given interface property.
+     */
+    public String getInterfacePropertyAlias(Class iface, String orig) {
+        synchronized (_ifaceMap) {
+            Map fields = (Map) _ifaceMap.get(iface);
+            if (fields == null)
+                return null;
+            return (String) fields.get(orig);
+        }
+    }
+    
+    /**
+     * Return all aliases property named for the given interface.
+     */
+    public String[] getInterfaceAliasedProperties(Class iface) {
+        synchronized (_ifaceMap) {
+            Map fields = (Map) _ifaceMap.get(iface);
+            if (fields == null)
+                return new String[0];
+            return (String[]) fields.keySet().toArray(new String[0]);
+        }
+    }
     
     /**
      * Return the number of fields that use impl or intermediate data, in
@@ -817,8 +888,8 @@
      * Return the superclass copy of the given field.
      */
     protected FieldMetaData getSuperclassField(FieldMetaData supField) {
-        FieldMetaData fmd = getPCSuperclassMetaData().
-            getField(supField.getName());
+        ClassMetaData sm = getPCSuperclassMetaData();
+        FieldMetaData fmd = sm == null ? null : sm.getField(supField.getName());
         if (fmd == null || fmd.getManagement() != fmd.MANAGE_PERSISTENT)
             throw new MetaDataException(_loc.get("unmanaged-sup-field",
                 supField, this));
@@ -1584,6 +1655,13 @@
         // resolve lifecycle metadata now to prevent lazy threading problems
         _lifeMeta.resolve();
 
+        // record implements in the repository
+        if (_interfaces != null) {
+            for (Iterator it = _interfaces.iterator(); it.hasNext();) {
+                _repos.addDeclaredInterfaceImpl(this, (Class) it.next());
+            }
+        }
+
         // resolve fetch groups
         if (_fgMap != null)
             for (Iterator itr = _fgMap.values().iterator(); itr.hasNext();)
@@ -1636,8 +1714,6 @@
      * Validate mapping data.
      */
     protected void validateMapping(boolean runtime) {
-        if (isMapped() && getIdentityType() == ID_UNKNOWN)
-            throw new MetaDataException(_loc.get("mapped-unknownid", this));
     }
 
     /**
@@ -1676,28 +1752,30 @@
      */
     private void validateIdentity(boolean runtime) {
         // make sure identity types are consistent
-        if (_super != null && _identity != -1
-            && getPCSuperclassMetaData().getIdentityType() != _identity)
+        ClassMetaData sup = getPCSuperclassMetaData();
+        int id = getIdentityType();
+        if (sup != null && sup.getIdentityType() != ID_UNKNOWN
+            && sup.getIdentityType() != id)
             throw new MetaDataException(_loc.get("id-types", _type));
 
         // check for things the data store doesn't support
         Collection opts = _repos.getConfiguration().supportedOptions();
-        if (getIdentityType() == ID_APPLICATION
+        if (id == ID_APPLICATION
             && !opts.contains(OpenJPAConfiguration.OPTION_ID_APPLICATION)) {
             throw new UnsupportedException(_loc.get("appid-not-supported",
                 _type));
         }
-        if (getIdentityType() == ID_DATASTORE
+        if (id == ID_DATASTORE
             && !opts.contains(OpenJPAConfiguration.OPTION_ID_DATASTORE)) {
             throw new UnsupportedException(_loc.get
                 ("datastoreid-not-supported", _type));
         }
 
-        if (getIdentityType() == ID_APPLICATION) {
+        if (id == ID_APPLICATION) {
             if (_idStrategy != ValueStrategies.NONE)
                 throw new MetaDataException(_loc.get("appid-strategy", _type));
             validateAppIdClass(runtime);
-        } else
+        } else if (id != ID_UNKNOWN)
             validateNoPKFields();
 
         int strategy = getIdentityStrategy();
@@ -2201,6 +2279,10 @@
             fg = addDeclaredFetchGroup(fgs[i].getName());
             fg.copy(fgs[i]); 
         }
+
+        // copy iface re-mapping
+        _ifaceMap.clear();
+        _ifaceMap.putAll(meta._ifaceMap);
     }
 
     /**

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java Mon Sep 18 14:57:52 2006
@@ -205,7 +205,7 @@
             return true;
         try {
             Method meth = iface.getDeclaredMethod("is" + StringUtils.capitalize
-                (fmd.getName()), null);
+                (fmd.getName()), (Class[]) null);
             return meth == null;
         } catch (NoSuchMethodException e) {}
         return true;

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataDefaults.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataDefaults.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataDefaults.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataDefaults.java Mon Sep 18 14:57:52 2006
@@ -28,10 +28,16 @@
     extends CallbackModes {
 
     /**
-     * Return the default access type for base persistent class with
+     * Return the default access type for a base persistent class with
      * {@link ClassMetaData#ACCESS_UNKNOWN} access type.
      */
     public int getDefaultAccessType();
+
+    /**
+     * Return the default identity type for unmapped classes without primary
+     * key fields.
+     */
+    public int getDefaultIdentityType();
 
     /**
      * What to do on lifecycle callback exceptions.

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java Mon Sep 18 14:57:52 2006
@@ -83,8 +83,8 @@
     public static final int VALIDATE_RUNTIME = 8;
 
     protected static final Class[] EMPTY_CLASSES = new Class[0];
-    protected static final PersistenceAwareClass[] EMPTY_PAWARE_CLASSES = 
-    	new PersistenceAwareClass[0];
+    protected static final NonPersistentMetaData[] EMPTY_NON_PERSISTENT = 
+    	new NonPersistentMetaData[0];
     protected final ClassMetaData[] EMPTY_METAS;
     protected final FieldMetaData[] EMPTY_FIELDS;
     protected final Order[] EMPTY_ORDERS;
@@ -92,11 +92,6 @@
     private static final Localizer _loc = Localizer.forPackage
         (MetaDataRepository.class);
 
-    // number of metadatas that have been registered thus far. This does not
-    // include dynamically-generated subclasses; it is just the count of
-    // user-created metadatas that were registered.
-    private int _count = 0;
-
     // system sequence
     private SequenceMetaData _sysSeq = null;
 
@@ -110,6 +105,7 @@
     private final Map _seqs = new HashMap();
     private final Map _aliases = Collections.synchronizedMap(new HashMap());
     private final Map _pawares = Collections.synchronizedMap(new HashMap());
+    private final Map _nonMapped = Collections.synchronizedMap(new HashMap());
     
     // map of classes to lists of their subclasses
     private final Map _subs = Collections.synchronizedMap(new HashMap());
@@ -741,7 +737,6 @@
             if (_pawares.containsKey(cls))
                 throw new MetaDataException(_loc.get("pc-and-aware", cls));
             _metas.put(cls, meta);
-            _count++;
         }
         return meta;
     }
@@ -862,7 +857,6 @@
             Class impl = (Class) _ifaces.remove(cls);
             if (impl != null)
                 _metas.remove(impl);
-            _count--;
             return true;
         }
         return false;
@@ -871,9 +865,23 @@
     /**
      * Add the given metadata as declared interface implementation.
      */
-    public void addDeclaredInterfaceImpl(ClassMetaData meta, Class iface) {
+    void addDeclaredInterfaceImpl(ClassMetaData meta, Class iface) {
         synchronized (_impls) {
-            addToCollection(_impls, iface, meta.getDescribedType(), false);
+            boolean supDec = false;
+            Collection vals = (Collection) _impls.get(iface);
+            
+            // check to see if the superclass already declares to avoid dups
+            if (vals != null) {
+                ClassMetaData sup = meta.getPCSuperclassMetaData();
+                while (vals != null && sup != null && !supDec) {
+                    supDec = vals.contains(sup.getDescribedType());
+                    sup = sup.getPCSuperclassMetaData();
+                }
+                if (supDec)
+                    return;
+            }
+
+            addToCollection(_impls, iface, meta.getDescribedType(), true);
         }
     }
 
@@ -886,6 +894,15 @@
                 meta, impl));
         _ifaces.put(meta.getDescribedType(), impl);
         _metas.put(impl, meta);
+        addDeclaredInterfaceImpl(meta, meta.getDescribedType());
+        ClassMetaData sup = meta.getPCSuperclassMetaData();
+        while (sup != null) {
+            // record superclass interface info while we can as well as we
+            // will only register concrete superclass in PCRegistry
+            sup.clearSubclassCache();
+            addToCollection(_subs, sup.getDescribedType(), impl, true);
+            sup = (ClassMetaData) sup.getPCSuperclassMetaData();
+        }
     }
     
     synchronized InterfaceImplGenerator getImplGenerator() {
@@ -1007,7 +1024,7 @@
             return EMPTY_METAS;
 
         // get impls of given interface / abstract class
-        processRegisteredClasses();
+        loadRegisteredClassMetaData(envLoader);
         Collection vals = (Collection) _impls.get(cls);
         ClassMetaData meta;
         Collection mapped = null;
@@ -1034,57 +1051,113 @@
     }
      
     /**
-     * Gets the persistence-aware class corresponding to the given class. Can
-     * be null, if the given class is not registered as persistence-aware with
-     * this receiver.
+     * Gets the metadata corresponding to the given persistence-aware class. 
+     * Returns null, if the given class is not registered as 
+     * persistence-aware.
      */
-    public PersistenceAwareClass getPersistenceAware(Class cls) {
-    	return (PersistenceAwareClass)_pawares.get(cls);
+    public NonPersistentMetaData getPersistenceAware(Class cls) {
+    	return (NonPersistentMetaData)_pawares.get(cls);
     }
     
     /**
-     * Gets all the registered persistence-aware classes.
+     * Gets all the metadatas for persistence-aware classes
      * 
-     * @return empty array if no class has been registered
+     * @return empty array if no class has been registered as pers-aware
      */
-    public PersistenceAwareClass[] getPersistenceAwares() {
+    public NonPersistentMetaData[] getPersistenceAwares() {
         synchronized (_pawares) {
             if (_pawares.isEmpty())
-                return EMPTY_PAWARE_CLASSES;
-            return (PersistenceAwareClass[])_pawares.values().toArray
-                (new PersistenceAwareClass[_pawares.size()]);
+                return EMPTY_NON_PERSISTENT;
+            return (NonPersistentMetaData[])_pawares.values().toArray
+                (new NonPersistentMetaData[_pawares.size()]);
         }
     }
 
     /**
-     * Add the given class as persitence-aware.
+     * Add the given class as persistence-aware.
      * 
      * @param cls non-null and must not alreaddy be added as persitence-capable
      */
-    public PersistenceAwareClass addPersistenceAware(Class cls) {
+    public NonPersistentMetaData addPersistenceAware(Class cls) {
     	if (cls == null)
     		return null;
         synchronized(this) {
             if (_pawares.containsKey(cls))
-                return (PersistenceAwareClass)_pawares.get(cls);
+                return (NonPersistentMetaData)_pawares.get(cls);
             if (getCachedMetaData(cls) != null)
                 throw new MetaDataException(_loc.get("pc-and-aware", cls));
-            PersistenceAwareClass result = new PersistenceAwareClass(cls, this);
-            _pawares.put(cls, result);
-            return result;
+            NonPersistentMetaData meta = new NonPersistentMetaData(cls, this,
+                NonPersistentMetaData.TYPE_PERSISTENCE_AWARE);
+            _pawares.put(cls, meta);
+            return meta;
     	}
     }
 
     /**
-     * Remove a persitence-aware class from this receiver.
+     * Remove a persitence-aware class from the repository
      * 
-     * @return true if removed, false if not contained in this receiver
+     * @return true if removed
      */
     public boolean removePersistenceAware(Class cls) {
     	return _pawares.remove(cls) != null;
     }
 
     /**
+     * Gets the metadata corresponding to the given non-mapped interface.
+     * Returns null, if the given interface is not registered as 
+     * persistence-aware.
+     */
+    public NonPersistentMetaData getNonMappedInterface(Class iface) {
+    	return (NonPersistentMetaData)_nonMapped.get(iface);
+    }
+    
+    /**
+     * Gets the corresponding metadatas for all registered, non-mapped
+     * interfaces
+     * 
+     * @return empty array if no non-mapped interface has been registered.
+     */
+    public NonPersistentMetaData[] getNonMappedInterfaces() {
+        synchronized (_nonMapped) {
+            if (_nonMapped.isEmpty())
+                return EMPTY_NON_PERSISTENT;
+            return (NonPersistentMetaData[])_nonMapped.values().toArray
+                (new NonPersistentMetaData[_nonMapped.size()]);
+        }
+    }
+
+    /**
+     * Add the given non-mapped interface to the repository.
+     * 
+     * @param iface the non-mapped interface
+     */
+    public NonPersistentMetaData addNonMappedInterface(Class iface) {
+    	if (iface == null)
+    		return null;
+        if (!iface.isInterface())
+            throw new MetaDataException(_loc.get("not-non-mapped", iface));
+        synchronized(this) {
+            if (_nonMapped.containsKey(iface))
+                return (NonPersistentMetaData)_nonMapped.get(iface);
+            if (getCachedMetaData(iface) != null)
+                throw new MetaDataException(_loc.get("non-mapped-pc", iface));
+            NonPersistentMetaData meta = new NonPersistentMetaData(iface, this,
+                NonPersistentMetaData.TYPE_NON_MAPPED_INTERFACE);
+            _nonMapped.put(iface, meta);
+            return meta;
+    	}
+    }
+
+    /**
+     * Remove a non-mapped interface from the repository
+     * 
+     * @return true if removed
+     */
+    public boolean removeNonMappedInterface(Class iface) {
+    	return _nonMapped.remove(iface) != null;
+    }
+
+    /**
      * Clear the cache of parsed metadata. This method also clears the
      * internal {@link MetaDataFactory MetaDataFactory}'s cache.
      */
@@ -1102,6 +1175,7 @@
         _factory.clear();
         _aliases.clear();
         _pawares.clear();
+        _nonMapped.clear();
     }
 
     /**
@@ -1317,8 +1391,6 @@
      * Update the list of implementations of base classes and interfaces.
      */
     private void updateImpls(Class cls, Class leastDerived, Class check) {
-        if (_factory.getDefaults().isDeclaredInterfacePersistent())
-            return;
         // allow users to query on common non-pc superclasses
         Class sup = check.getSuperclass();
         if (leastDerived == cls && sup != null && sup != Object.class) {
@@ -1326,6 +1398,10 @@
             updateImpls(cls, leastDerived, sup);
         }
 
+        // allow users to query on any implemented interfaces unless defaults 
+        // say the user must create persistent interfaces explicitly
+        if (!_factory.getDefaults().isDeclaredInterfacePersistent())
+            return;
         Class[] ints = check.getInterfaces();
         for (int i = 0; i < ints.length; i++) {
             // don't map java-standard interfaces

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/NoneMetaDataFactory.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/NoneMetaDataFactory.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/NoneMetaDataFactory.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/NoneMetaDataFactory.java Mon Sep 18 14:57:52 2006
@@ -93,6 +93,10 @@
         return ClassMetaData.ACCESS_UNKNOWN;
     }
 
+    public int getDefaultIdentityType() {
+        return ClassMetaData.ID_UNKNOWN;
+    }
+
     public int getCallbackMode() {
         return CALLBACK_IGNORE;
     }

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueMetaDataImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueMetaDataImpl.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueMetaDataImpl.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueMetaDataImpl.java Mon Sep 18 14:57:52 2006
@@ -433,10 +433,11 @@
         _attach = vmd.getCascadeAttach();
         _refresh = vmd.getCascadeRefresh();
         _typeOverride = vmd.getTypeOverride();
+        _serialized = vmd.isSerialized();
         if (_embeddedMeta != null)
             _embeddedMeta.setDescribedType(vmd.getDeclaredType());
 
-        // don't allow copy to override embedded; don't copy serialized at all
+        // don't allow copy to override embedded
         if (_embedded == null)
             setEmbedded(vmd.isEmbedded());
     }

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java Mon Sep 18 14:57:52 2006
@@ -17,6 +17,7 @@
 
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.BitSet;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
@@ -139,7 +140,8 @@
      */
     public static Object generateFieldValue(StoreContext ctx,
         FieldMetaData fmd) {
-        return generateValue(ctx, null, fmd, fmd.getDeclaredTypeCode());
+        return generateValue(ctx, fmd.getDefiningMetaData(), fmd, 
+            fmd.getDeclaredTypeCode());
     }
 
     /**
@@ -163,6 +165,30 @@
             default:
                 return null;
         }
+    }
+
+    /** 
+     * Returns the fields of the state that require an update. 
+     *  
+     * @param  sm  the state to check
+     * @return the BitSet of fields that need update, or null if none
+     */
+    public static BitSet getUpdateFields(OpenJPAStateManager sm) {
+
+        if ((sm.getPCState() == PCState.PDIRTY
+            && (!sm.isFlushed() || sm.isFlushedDirty()))
+            || (sm.getPCState() == PCState.PNEW && sm.isFlushedDirty())) {
+            BitSet dirty = sm.getDirty();
+            if (sm.isFlushed()) {
+                dirty = (BitSet) dirty.clone();
+                dirty.andNot(sm.getFlushed());
+            }
+
+            if (dirty.length() > 0)
+                return dirty;
+        }
+
+        return null;
     }
 
     /**

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/resources/org/apache/openjpa/event/localizer.properties
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/resources/org/apache/openjpa/event/localizer.properties?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/resources/org/apache/openjpa/event/localizer.properties (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/resources/org/apache/openjpa/event/localizer.properties Mon Sep 18 14:57:52 2006
@@ -75,4 +75,5 @@
 tcp-wrong-version-error: Received packet from "{0}" with invalid version \
 	number. Check if a prior release of OpenJPA is being used on this host.
 bean-constructor: Could not instantiate class {0}.
-method-notfound: Method "{1}" not found in class "{0}".
+method-notfound: Method "{1}" with arguments of type: {2} \
+    not found in class "{0}".

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties Mon Sep 18 14:57:52 2006
@@ -48,6 +48,10 @@
 	marked for rollback only.  The transaction will be rolled back instead.
 refresh-flushed: You cannot refresh an instance that has been flushed to the \
 	data store.
+pc-loader-different: Attempt to cast instance "{0}" to PersistenceCapable failed. \
+    The object implemented org.apache.openjpa.enhance.PersistenceCapable, \
+    but the instance of that interface was loaded by two different ClassLoaders: \
+    "{1}" and "{2}".
 pc-cast: Attempt to cast instance "{0}" to PersistenceCapable failed.  Ensure \
 	that it has been enhanced.
 del-instance: The instance of type "{0}" with oid "{1}" no longer exists in \

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties Mon Sep 18 14:57:52 2006
@@ -20,6 +20,8 @@
 found-pcs: Found {0} classes with metadata in {1} milliseconds.
 not-managed-interface: Cannot set type "{1}" as interface "{0}" implementor. \
     "{0}" is not a managed interface.
+declare-non-interface: Cannot declare on type "{0}" interface "{1}" as it is \
+    not an interface.
 unmanaged-sup-field: Superclass field "{0}" is mapped in the metadata for \
 	subclass "{1}", but is not a persistent field.
 bad-discover-class: The class "{0}" listed in the openjpa.MetaDataFactory \
@@ -250,9 +252,6 @@
 	access. Only one access method is permitted.
 unsupported-id-type: Type "{0}" declares field "{1}" as a primary key, but \
 	keys of type "{2}" are not supported.
-mapped-unknownid: Type "{0}" is mapped to the data store, but does not have \
-	an identity type.  Alter its metadata to declare datastore identity or \
-	to have at least one primary key field.
 empty-fg-name: Attempt to add an unnamed fetch group to "{0}".
 invalid-fg-depth: Fetch group "{0}" specifies invalid recursion depth "{2}" \
     for field "{1}". Recursion depth must be greater than or equal to -1.
@@ -262,8 +261,13 @@
     group "{0}".
 unknown-fg: Attempt to add fetch group "{0}" to type field "{1}" failed. \
     This fetch group has not been defined.
+duplicate-iface-alias: Cannot alias interface "{0}" property "{1}" to local \
+    field "{2}" as the property has already been aliased.
 pc-and-aware: Attempt to register "{0}" as a persistence-aware class failed. \
-	The same class has been registered as persistence-capable already.=======
+	The same class has been registered as persistence-capable already.
+not-non-mapped: Type "{0}" cannot be a non-mapped interface as the class is \
+    not an interface
+non-mapped-pc: A non-mapped interface cannot also be mapped.
 no-metadatafactory: No configuration properties were found. If you are \
     using Ant, please see the <properties> or <propertiesFile> attributes \
     of the task''s nested <config> element.

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java Mon Sep 18 14:57:52 2006
@@ -42,6 +42,7 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.MissingResourceException;
@@ -372,11 +373,19 @@
         if (_mds != null)
             return _mds;
         PropertyDescriptor[] pds = getPropertyDescriptors();
-        _mds = new MethodDescriptor[pds.length * 2];
+
+        List descs = new LinkedList(); 
         for (int i = 0; i < pds.length; i++) {
-            _mds[i * 2] = new MethodDescriptor(pds[i].getWriteMethod());
-            _mds[(i * 2) + 1] = new MethodDescriptor(pds[i].getReadMethod());
+            Method write = pds[i].getWriteMethod();
+            Method read = pds[i].getReadMethod();
+            if (read != null && write != null) {
+                descs.add(new MethodDescriptor(write));
+                descs.add(new MethodDescriptor(read));
+            }
         }
+
+        _mds = (MethodDescriptor[])descs.
+            toArray(new MethodDescriptor[descs.size()]);
         return _mds;
     }
 

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java Mon Sep 18 14:57:52 2006
@@ -18,8 +18,10 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.MissingResourceException;
 import java.util.Properties;
@@ -30,6 +32,7 @@
 
 import org.apache.commons.lang.exception.NestableRuntimeException;
 import org.apache.openjpa.lib.log.Log;
+import org.apache.openjpa.lib.util.JavaVersions;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.Options;
 import org.apache.openjpa.lib.util.ParseException;
@@ -466,36 +469,40 @@
             (ConfigurationProvider.class, loader);
         ConfigurationProvider provider = null;
         int providerCount = 0;
-        StringBuffer errs = null;
+        List errs = null;
         for (int i = 0; i < impls.length; i++) {
-            provider = newProvider(impls[i]);
-            if (provider == null)
-                continue;
-
-            providerCount++;
             try {
+                provider = (ConfigurationProvider) impls[i].newInstance();
+                if (provider == null)
+                    continue;
+
+                providerCount++;
+
                 if ((globals && provider.loadGlobals(loader))
                     || (!globals && provider.loadDefaults(loader)))
                     return provider;
             } catch (MissingResourceException mre) {
                 throw mre;
-            } catch (Exception e) {
-                if (errs == null)
-                    errs = new StringBuffer();
-                else
-                    errs.append(", ");
-                errs.append(e.toString());
+            } catch (Throwable t) {
+                (errs == null ? errs = new ArrayList() : errs).add(t);
             }
         }
 
         String type = (globals) ? "globals" : "defaults";
+        MissingResourceException ex = null;
+
         if (errs != null)
-            throw new MissingResourceException(errs.toString(),
+            ex = new MissingResourceException(errs.toString(),
                 Configurations.class.getName(), type);
-        if (providerCount == 0)
-            throw new MissingResourceException(_loc.get ("no-providers", 
+        else if (providerCount == 0)
+            ex = new MissingResourceException(_loc.get ("no-providers", 
                 ConfigurationProvider.class.getName()).getMessage(),
                 Configurations.class.getName(), type);
+
+        if (ex != null)
+            throw (MissingResourceException) JavaVersions.initCause(ex,
+                errs.size() == 0 ? null : (Throwable) errs.get(0));
+
         return null;
     }
 

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java Mon Sep 18 14:57:52 2006
@@ -1029,7 +1029,7 @@
      * A ClassLoader that is completely isolated with respect to
      * any classes that are loaded in the System ClassLoader.
      *
-     * @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
+     * @author Marc Prud'hommeaux
      */
     private static class IsolatedClassLoader extends NestedClassLoader {
 
@@ -1460,7 +1460,7 @@
      * if a test hasn't completed in a shorted amount of time than
      * the global test timeout.
      *
-     * @author <a href="mailto:marc@solarmetric.com">Marc Prud'hommeaux</a>
+     * @author Marc Prud'hommeaux
      */
     private static class WatchdogThread extends Thread {
 

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCFetchPlan.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCFetchPlan.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCFetchPlan.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCFetchPlan.java Mon Sep 18 14:57:52 2006
@@ -15,15 +15,10 @@
  */
 package org.apache.openjpa.persistence.jdbc;
 
-import org.apache.openjpa.jdbc.kernel.DelegatingJDBCFetchConfiguration;
 import org.apache.openjpa.jdbc.kernel.EagerFetchModes;
-import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
 import org.apache.openjpa.jdbc.kernel.LRSSizes;
 import org.apache.openjpa.jdbc.sql.JoinSyntaxes;
-import org.apache.openjpa.kernel.DelegatingFetchConfiguration;
-import org.apache.openjpa.kernel.FetchConfiguration;
 import org.apache.openjpa.persistence.FetchPlan;
-import org.apache.openjpa.persistence.PersistenceExceptions;
 
 /**
  * JDBC extensions to the fetch plan.
@@ -36,27 +31,87 @@
 public interface JDBCFetchPlan
     extends FetchPlan, EagerFetchModes, LRSSizes, JoinSyntaxes {
 
+    /**
+     * Eager fetch mode in loading relations.
+     * 
+     * @see EagerFetchModes
+     */
     public int getEagerFetchMode();
 
+    /**
+     * Eager fetch mode in loading relations.
+     * 
+     * @see EagerFetchModes
+     */
     public JDBCFetchPlan setEagerFetchMode(int mode);
 
+    /**
+     * Eager fetch mode in loading subclasses.
+     * 
+     * @see EagerFetchModes
+     */
     public int getSubclassFetchMode();
 
+    /**
+     * Eager fetch mode in loading subclasses.
+     * 
+     * @see EagerFetchModes
+     */
     public JDBCFetchPlan setSubclassFetchMode(int mode);
 
+    /**
+     * Type of JDBC result set to use for query results.
+     * 
+     * @see java.sql.ResultSet
+     */
     public int getResultSetType();
 
+    /**
+     * Type of JDBC result set to use for query results.
+     * 
+     * @see java.sql.ResultSet
+     */
     public JDBCFetchPlan setResultSetType(int type);
 
+    /**
+     * Result set fetch direction.
+     * 
+     * @see java.sql.ResultSet
+     */
     public int getFetchDirection();
 
+    /**
+     * Result set fetch direction.
+     * 
+     * @see java.sql.ResultSet
+     */
     public JDBCFetchPlan setFetchDirection(int direction);
 
+    /**
+     * How to determine the size of a large result set.
+     * 
+     * @see LRSSizes
+     */
     public int getLRSSize();
 
+    /**
+     * How to determine the size of a large result set.
+     * 
+     * @see LRSSizes
+     */
     public JDBCFetchPlan setLRSSize(int lrsSize);
 
+    /**
+     * SQL join syntax.
+     *
+     * @see JoinSyntaxes
+     */
     public int getJoinSyntax();
 
+    /**
+     * SQL join syntax.
+     *
+     * @see JoinSyntaxes
+     */
     public JDBCFetchPlan setJoinSyntax(int syntax);
 }

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCFetchPlanImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCFetchPlanImpl.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCFetchPlanImpl.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCFetchPlanImpl.java Mon Sep 18 14:57:52 2006
@@ -31,7 +31,6 @@
  *
  * @since 0.4.0
  * @author Abe White
- * @published
  */
 public class JDBCFetchPlanImpl
     extends FetchPlanImpl

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestPersistence.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestPersistence.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestPersistence.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestPersistence.java Mon Sep 18 14:57:52 2006
@@ -15,6 +15,8 @@
  */
 package org.apache.openjpa.persistence.simple;
 
+import java.util.HashMap;
+import java.util.Map;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 import javax.persistence.EntityTransaction;
@@ -27,30 +29,25 @@
 /**
  * Simple test case to get an EntityManager and perform some basic operations.
  *
- * @author <a href="mailto:mprudhom@bea.com">Marc Prud'hommeaux</a>
+ * @author Marc Prud'hommeaux
  */
 public class TestPersistence
     extends TestCase {
 
     private EntityManagerFactory emf;
 
-    protected EntityManager getEM() {
-        if (emf == null)
-            emf = Persistence.createEntityManagerFactory("simple-emf-test");
-        assertNotNull(emf);
-
-        EntityManager em = emf.createEntityManager();
-        assertNotNull(em);
-
-        return em;
+    public void setUp() {
+        Map props = new HashMap();
+        props.put("openjpa.MetaDataFactory",
+            "jpa(Types=" + AllFieldTypes.class.getName() + ")");
+        emf = Persistence.createEntityManagerFactory("test", props);
     }
 
-    public void tearDown()
-        throws Exception {
-        super.tearDown();
-
+    public void tearDown() {
+        if (emf == null)
+            return;
         try {
-            EntityManager em = getEM();
+            EntityManager em = emf.createEntityManager();
             em.getTransaction().begin();
             em.createQuery("delete from AllFieldTypes").executeUpdate();
             em.getTransaction().commit();
@@ -61,11 +58,10 @@
     }
 
     public void testCreateEntityManager() {
-        EntityManager em = getEM();
+        EntityManager em = emf.createEntityManager();
 
         EntityTransaction t = em.getTransaction();
         assertNotNull(t);
-
         t.begin();
         t.setRollbackOnly();
         t.rollback();
@@ -75,14 +71,11 @@
         OpenJPAEntityManager ojem = (OpenJPAEntityManager) em;
         ojem.getFetchPlan().setMaxFetchDepth(-1);
         assertEquals(-1, ojem.getFetchPlan().getMaxFetchDepth());
-
         em.close();
     }
 
     public void testPersist() {
-        EntityManager em;
-
-        em = getEM();
+        EntityManager em = emf.createEntityManager();
         em.getTransaction().begin();
         em.persist(new AllFieldTypes());
         em.getTransaction().commit();
@@ -90,9 +83,7 @@
     }
 
     public void testQuery() {
-        EntityManager em;
-
-        em = getEM();
+        EntityManager em = emf.createEntityManager();
         em.getTransaction().begin();
         AllFieldTypes aft = new AllFieldTypes();
         aft.setStringField("foo");
@@ -101,7 +92,7 @@
         em.getTransaction().commit();
         em.close();
 
-        em = getEM();
+        em = emf.createEntityManager();
         em.getTransaction().begin();
         assertEquals(1, em.createQuery
             ("select x from AllFieldTypes x where x.stringField = 'foo'").

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml Mon Sep 18 14:57:52 2006
@@ -1,24 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <persistence xmlns="http://java.sun.com/xml/ns/persistence"
-             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-             version="1.0">
-
-    <persistence-unit name="simple-emf-test">
-
-        <!-- This is not needed if OpenJPA is the only persistence provider
-             in the classpath.
-          <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
-          -->
-
-        <class>org.apache.openjpa.persistence.simple.AllFieldTypes</class>
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    version="1.0">
 
+    <persistence-unit name="test">
+        <!-- 
+        <provider>
+            org.apache.openjpa.persistence.PersistenceProviderImpl
+        </provider>
+        -->
         <properties>
             <property name="openjpa.ConnectionDriverName"
-                      value="org.apache.commons.dbcp.BasicDataSource"/>
+                value="org.apache.commons.dbcp.BasicDataSource"/>
             <property name="openjpa.ConnectionProperties"
-                      value="DriverClassName=org.apache.derby.jdbc.EmbeddedDriver,Url=jdbc:derby:target/database/openjpa-test-database;create=true,MaxActive=100,MaxWait=10000,TestOnBorrow=true"/>
+                value="DriverClassName=org.apache.derby.jdbc.EmbeddedDriver,Url=jdbc:derby:target/database/openjpa-test-database;create=true,MaxActive=100,MaxWait=10000,TestOnBorrow=true"/>
             <property name="openjpa.jdbc.SynchronizeMappings"
-                      value="buildSchema(ForeignKeys=true)"/>
+                value="buildSchema(ForeignKeys=true)"/>
         </properties>
     </persistence-unit>
 </persistence>

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java Mon Sep 18 14:57:52 2006
@@ -472,11 +472,9 @@
         if (isMetaDataMode()) {
             // while the spec only provides for embedded exclusive, it doesn't
             // seem hard to support otherwise
-            if (entity == null) {
+            if (entity == null)
                 meta.setEmbeddedOnly(true);
-                if (_cls.isAnnotationPresent(MappedSuperclass.class))
-                    meta.setIdentityType(ClassMetaData.ID_UNKNOWN);
-            } else {
+            else {
                 meta.setEmbeddedOnly(false);
                 if (!StringUtils.isEmpty(entity.name()))
                     meta.setTypeAlias(entity.name());
@@ -1202,7 +1200,7 @@
         if (!anno.optional())
             fmd.setNullValue(FieldMetaData.NULL_EXCEPTION);
         if (anno.targetEntity() != void.class)
-            fmd.setDeclaredType(anno.targetEntity());
+            fmd.setTypeOverride(anno.targetEntity());
         setCascades(fmd, anno.cascade());
     }
 
@@ -1225,7 +1223,7 @@
         if (isMappingOverrideMode() && !StringUtils.isEmpty(anno.mappedBy()))
             fmd.setMappedBy(anno.mappedBy());
         if (anno.targetEntity() != void.class)
-            fmd.setDeclaredType(anno.targetEntity());
+            fmd.setTypeOverride(anno.targetEntity());
         setCascades(fmd, anno.cascade());
     }
 
@@ -1463,9 +1461,9 @@
             props = null;
         } else if (seq.indexOf('(') != -1) // plugin
         {
-            seq = null;
             clsName = Configurations.getClassName(seq);
             props = Configurations.getProperties(seq);
+            seq = null;
         } else {
             clsName = SequenceMetaData.IMPL_NATIVE;
             props = null;

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java Mon Sep 18 14:57:52 2006
@@ -112,8 +112,9 @@
         _factory.lock();
         try {
             if (_queryCache == null)
-                _queryCache = new QueryResultCacheImpl(_factory.getConfiguration().
-                    getDataCacheManagerInstance().getSystemQueryCache());
+                _queryCache = new QueryResultCacheImpl(_factory.
+                    getConfiguration().getDataCacheManagerInstance().
+                    getSystemQueryCache());
             return _queryCache;
         } finally {
             _factory.unlock();

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/Extent.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/Extent.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/Extent.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/Extent.java Mon Sep 18 14:57:52 2006
@@ -15,22 +15,17 @@
  */
 package org.apache.openjpa.persistence;
 
-import java.util.Iterator;
 import java.util.List;
 
-import org.apache.openjpa.kernel.DelegatingExtent;
-
 /**
  * An extent is a logical view of all instances of a class.
  *
  * @author Abe White
- * @author Pinaki Poddar
  * @since 0.4.0
  * @published
  */
 public interface Extent<T>
     extends Iterable<T> {
-
 
     /**
      * Delegate.

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ExtentImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ExtentImpl.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ExtentImpl.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ExtentImpl.java Mon Sep 18 14:57:52 2006
@@ -24,7 +24,6 @@
  * An extent is a logical view of all instances of a class.
  *
  * @author Abe White
- * @author Pinaki Poddar
  * @since 0.4.1
  * @nojavadoc
  */
@@ -34,7 +33,6 @@
     private final EntityManagerImpl _em;
     private final DelegatingExtent _extent;
     private FetchPlan _fetch = null;
-
 
     /**
      * Constructor; supply delegate.

Modified: incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/FetchPlan.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/FetchPlan.java?view=diff&rev=447584&r1=447583&r2=447584
==============================================================================
--- incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/FetchPlan.java (original)
+++ incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/FetchPlan.java Mon Sep 18 14:57:52 2006
@@ -15,13 +15,9 @@
  */
 package org.apache.openjpa.persistence;
 
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
-import java.util.Iterator;
 import javax.persistence.LockModeType;
 
-import org.apache.openjpa.kernel.DelegatingFetchConfiguration;
 import org.apache.openjpa.kernel.FetchConfiguration;
 import org.apache.openjpa.meta.FetchGroup;
 
@@ -56,7 +52,6 @@
      */
     public static final int DEFAULT = FetchConfiguration.DEFAULT;
 
-
     /**
      * Delegate.
      */
@@ -120,6 +115,7 @@
      * use when loading objects.
      */
     public FetchPlan addFetchGroups(String... groups);
+
     /**
      * Adds <code>groups</code> to the set of fetch group names to
      * use when loading objects.



Mime
View raw message