Formatting.

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@443073 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
A. Abram White 2006-09-13 18:57:13 +00:00
parent 912c1262d6
commit a9eaf4683b
26 changed files with 33 additions and 36 deletions

View File

@ -67,8 +67,8 @@ public class DiscriminatorMappingInfo
return discrim.getMappingRepository().getMappingDefaults(). return discrim.getMappingRepository().getMappingDefaults().
getDiscriminatorValue(discrim, adapt); getDiscriminatorValue(discrim, adapt);
if (_value.length() > 0 && if (_value.length() > 0 && (_value.charAt(0) == '-'
(_value.charAt(0) == '-' || Character.isDigit(_value.charAt(0)))) { || Character.isDigit(_value.charAt(0)))) {
try { try {
if (_value.indexOf('.') == -1) if (_value.indexOf('.') == -1)
return new Integer(_value); return new Integer(_value);

View File

@ -1747,8 +1747,8 @@ public class BrokerImpl
_flags &= ~FLAG_ACTIVE; _flags &= ~FLAG_ACTIVE;
_flags &= ~FLAG_FLUSHED; _flags &= ~FLAG_FLUSHED;
if (_transEventManager != null && if (_transEventManager != null
_transEventManager.hasEndListeners()) { && _transEventManager.hasEndListeners()) {
_transEventManager.fireEvent(new TransactionEvent(this, _transEventManager.fireEvent(new TransactionEvent(this,
status == Status.STATUS_COMMITTED status == Status.STATUS_COMMITTED
? TransactionEvent.AFTER_COMMIT_COMPLETE ? TransactionEvent.AFTER_COMMIT_COMPLETE
@ -3016,11 +3016,9 @@ public class BrokerImpl
StateManagerImpl sm; StateManagerImpl sm;
for (Iterator itr = states.iterator(); itr.hasNext();) { for (Iterator itr = states.iterator(); itr.hasNext();) {
sm = (StateManagerImpl) itr.next(); sm = (StateManagerImpl) itr.next();
if (!sm.isPersistent()) { if (!sm.isPersistent())
if (sm.getPCState() != PCState.TCLEAN)
sm.nontransactional();
itr.remove(); itr.remove();
} else if (!sm.getMetaData().isDetachable()) { else if (!sm.getMetaData().isDetachable()) {
sm.release(true); sm.release(true);
itr.remove(); itr.remove();
} }

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * Lifecycle state.
* Represents an embedded instance that is managed by a StateManager and * Represents an embedded instance that is managed by a StateManager and
* may be participating in the current transaction, but has not yet been * may be participating in the current transaction, but has not yet been
* modified. * modified.
* *

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * Lifecycle state.
* Represents an instance that was copied and made embedded within the * Represents an instance that was copied and made embedded within the
* current transaction. * current transaction.
* *
* @author Abe White * @author Abe White

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * Lifecycle state.
* Represents an embedded instance that has been deleted in the current * Represents an embedded instance that has been deleted in the current
* transaction. * transaction.
* *
* @author Abe White * @author Abe White

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * Lifecycle state.
* Represents an embedded instance that is participating in the current * Represents an embedded instance that is participating in the current
* transaction, and has been modified. * transaction, and has been modified.
* *
* @author Abe White * @author Abe White

View File

@ -55,13 +55,11 @@ class ENonTransState
} }
PCState beforeRead(StateManagerImpl context, int field) { PCState beforeRead(StateManagerImpl context, int field) {
error("embed-ref", context); return error("embed-ref", context);
return null;
} }
PCState beforeWrite(StateManagerImpl context, int field, boolean mutate) { PCState beforeWrite(StateManagerImpl context, int field, boolean mutate) {
error("embed-ref", context); return error("embed-ref", context);
return null;
} }
PCState beforeOptimisticWrite(StateManagerImpl context, int field, PCState beforeOptimisticWrite(StateManagerImpl context, int field,

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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 * 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 * (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 * traversing relations, and the state of persistent instances outside of

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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. * transaction, but has not yet been modified.
* *
* @author Abe White * @author Abe White

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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. * transaction, and that has been flushed to the database.
* *
* @author Patrick Linskey * @author Patrick Linskey

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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. * transaction.
* *
* @author Abe White * @author Abe White

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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. * transaction, and has been modified.
* *
* @author Abe White * @author Abe White

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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. * current transaction.
* *
* @author Abe White * @author Abe White

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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. * current transaction, flushed, deleted, and flushed.
* *
* @author Patrick Linskey * @author Patrick Linskey

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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. * current transaction, flushed, and subsequently deleted.
* *
* @author Patrick Linskey * @author Patrick Linskey

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * Lifecycle state.
* Represents an instance that was made persistent within the * Represents an instance that was made persistent within the
* current transaction. * current transaction.
* *
* @author Abe White * @author Abe White

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * Lifecycle state.
* Represents an instance that was deleted outside a transaction. * Represents an instance that was deleted outside a transaction.
* *
* @author Steve Kim * @author Steve Kim
*/ */

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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 * transaction. This state is only reachable only if the
* RetainNontransactional property is set. * RetainNontransactional property is set.
* *

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * Lifecycle state.
* Represents an instance that was persisted outside a transaction. * Represents an instance that was persisted outside a transaction.
* *
* @author Steve Kim * @author Steve Kim
*/ */

View File

@ -21,7 +21,7 @@ import org.apache.openjpa.lib.util.Localizer;
/** /**
* Lifecycle state. * 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 * allows access to persistent data. This state is reachable only if the
* RetainState property is set. * RetainState property is set.
* *

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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 * may be participating in the current transaction, but has not yet been
* modified. * modified.
* *

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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. * transaction, and has been modified.
* *
* @author Abe White * @author Abe White

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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 * are loaded for the purpose of field inspection such
* as for cascades. This state should be released as soon as inspection * as for cascades. This state should be released as soon as inspection
* is complete. * is complete.

View File

@ -17,7 +17,7 @@ package org.apache.openjpa.kernel;
/** /**
* Lifecycle state. * 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 * the {@link #initialize} method, which immediately removes the
* persistence capable instance from management by the OpenJPA runtime. * persistence capable instance from management by the OpenJPA runtime.
* *

View File

@ -1127,9 +1127,9 @@ public class MetaDataRepository
public NonPersistentMetaData addNonMappedInterface(Class iface) { public NonPersistentMetaData addNonMappedInterface(Class iface) {
if (iface == null) if (iface == null)
return null; return null;
if (!iface.isInterface())
throw new MetaDataException(_loc.get("not-non-mapped", iface));
synchronized(this) { synchronized(this) {
if (!iface.isInterface())
throw new MetaDataException(_loc.get("not-non-mapped", iface));
if (_nonMapped.containsKey(iface)) if (_nonMapped.containsKey(iface))
return (NonPersistentMetaData)_nonMapped.get(iface); return (NonPersistentMetaData)_nonMapped.get(iface);
if (getCachedMetaData(iface) != null) if (getCachedMetaData(iface) != null)

View File

@ -433,10 +433,11 @@ public class ValueMetaDataImpl
_attach = vmd.getCascadeAttach(); _attach = vmd.getCascadeAttach();
_refresh = vmd.getCascadeRefresh(); _refresh = vmd.getCascadeRefresh();
_typeOverride = vmd.getTypeOverride(); _typeOverride = vmd.getTypeOverride();
_serialized = vmd.isSerialized();
if (_embeddedMeta != null) if (_embeddedMeta != null)
_embeddedMeta.setDescribedType(vmd.getDeclaredType()); _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) if (_embedded == null)
setEmbedded(vmd.isEmbedded()); setEmbedded(vmd.isEmbedded());
} }