mirror of https://github.com/apache/openjpa.git
Formatting.
git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@443073 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
912c1262d6
commit
a9eaf4683b
|
@ -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);
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
||||||
*
|
*
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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.
|
||||||
*
|
*
|
||||||
|
|
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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.
|
||||||
*
|
*
|
||||||
|
|
|
@ -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.
|
||||||
*
|
*
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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.
|
||||||
*
|
*
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue