Top Description Fields Constructors Methods
org.hibernate.action.internal

public Class UnresolvedEntityInsertActions

extends Object
Class Inheritance
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serializable, java.util.Collections, .IdentityHashMap, .Map, .Set, .TreeSet, org.hibernate.PropertyValueException, .TransientPropertyValueException, org.hibernate.engine.internal.NonNullableTransientDependencies, org.hibernate.engine.spi.EntityEntry, .SessionImplementor, .SharedSessionContractImplementor, .Status, org.hibernate.internal.CoreMessageLogger, org.hibernate.internal.util.collections.IdentitySet, org.hibernate.pretty.MessageHelper, org.jboss.logging.Logger

Tracks unresolved entity insert actions. An entity insert action is unresolved if the entity to be inserted has at least one non-nullable association with an unsaved transient entity, and the foreign key points to that unsaved transient entity. These references must be resolved before an insert action can be executed.
Author
Gail Badner

Field Summary

Modifier and TypeField and Description
private final Map<AbstractEntityInsertAction, NonNullableTransientDependencies>
private final Map<Object, Set<AbstractEntityInsertAction>>
private static final int
private static final CoreMessageLogger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public void
addUnresolvedEntityInsertAction(AbstractEntityInsertAction
- unresolved insert action.
insert
,
NonNullableTransientDependencies
- non-nullable transient dependencies (must be non-null and non-empty).
dependencies
)

Add an unresolved insert action.

public void
checkNoUnresolvedActionsAfterOperation()

Throws org.hibernate.PropertyValueException if there are any unresolved entity insert actions that depend on non-nullable associations with a transient entity.

public void
public static UnresolvedEntityInsertActions

Returns:

the deserialized UnresolvedEntityInsertActions object
deserialize
(ObjectInputStream
- the input stream.
ois
,
SessionImplementor
- the session.
session
)

Deprecated as a consequence of SessionImplementor being deprecated.
Deserialize an UnresolvedEntityInsertActions object.
public Iterable<AbstractEntityInsertAction>

Returns:

the unresolved insert actions.
getDependentEntityInsertActions
()

Returns the unresolved insert actions.

public boolean

Returns:

true, if there are no unresolved entity insert actions; false, otherwise.
isEmpty
()

Returns true if there are no unresolved entity insert actions.

private void
public Set<AbstractEntityInsertAction>

Returns:

the insert actions that depended only on the specified entity.
resolveDependentActions
(Object
- the managed entity name
managedEntity
,
SessionImplementor
- the session
session
)

Deprecated as a consequence of SessionImplementor being deprecated.
Resolve any dependencies on managedEntity.
public void
serialize(ObjectOutputStream
- the output stream
oos
)

Serialize this UnresolvedEntityInsertActions object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

dependenciesByActionback to summary
private final Map<AbstractEntityInsertAction, NonNullableTransientDependencies> dependenciesByAction
dependentActionsByTransientEntityback to summary
private final Map<Object, Set<AbstractEntityInsertAction>> dependentActionsByTransientEntity
INIT_SIZEback to summary
private static final int INIT_SIZE
LOGback to summary
private static final CoreMessageLogger LOG

Constructor Detail

UnresolvedEntityInsertActionsback to summary
public UnresolvedEntityInsertActions()

Method Detail

addDependenciesByTransientEntityback to summary
private void addDependenciesByTransientEntity(AbstractEntityInsertAction insert, NonNullableTransientDependencies dependencies)
Annotations
@SuppressWarnings:unchecked
addUnresolvedEntityInsertActionback to summary
public void addUnresolvedEntityInsertAction(AbstractEntityInsertAction insert, NonNullableTransientDependencies dependencies)

Add an unresolved insert action.

Parameters
insert:AbstractEntityInsertAction

- unresolved insert action.

dependencies:NonNullableTransientDependencies

- non-nullable transient dependencies (must be non-null and non-empty).

Exceptions
IllegalArgumentException:
if dependencies is null or empty.
checkNoUnresolvedActionsAfterOperationback to summary
public void checkNoUnresolvedActionsAfterOperation() throws PropertyValueException

Throws org.hibernate.PropertyValueException if there are any unresolved entity insert actions that depend on non-nullable associations with a transient entity. This method should be called on completion of an operation (after all cascades are completed) that saves an entity.

Exceptions
PropertyValueException:
if there are any unresolved entity insert actions; org.hibernate.PropertyValueException#getEntityName() and org.hibernate.PropertyValueException#getPropertyName() will return the entity name and property value for the first unresolved entity insert action.
clearback to summary
public void clear()

Clear this UnresolvedEntityInsertActions.

deserializeback to summary
public static UnresolvedEntityInsertActions deserialize(ObjectInputStream ois, SessionImplementor session) throws IOException, ClassNotFoundException

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

Deserialize an UnresolvedEntityInsertActions object.

Parameters
ois:ObjectInputStream

- the input stream.

session:SessionImplementor

- the session.

Returns:UnresolvedEntityInsertActions

the deserialized UnresolvedEntityInsertActions object

Exceptions
IOException:
if there is an error writing this object to the output stream.
ClassNotFoundException:
if there is a class that cannot be loaded.
getDependentEntityInsertActionsback to summary
public Iterable<AbstractEntityInsertAction> getDependentEntityInsertActions()

Returns the unresolved insert actions.

Returns:Iterable<AbstractEntityInsertAction>

the unresolved insert actions.

isEmptyback to summary
public boolean isEmpty()

Returns true if there are no unresolved entity insert actions.

Returns:boolean

true, if there are no unresolved entity insert actions; false, otherwise.

logCannotResolveNonNullableTransientDependenciesback to summary
private void logCannotResolveNonNullableTransientDependencies(SharedSessionContractImplementor session)
resolveDependentActionsback to summary
public Set<AbstractEntityInsertAction> resolveDependentActions(Object managedEntity, SessionImplementor session)

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

Resolve any dependencies on managedEntity.

Parameters
managedEntity:Object

- the managed entity name

session:SessionImplementor

- the session

Returns:Set<AbstractEntityInsertAction>

the insert actions that depended only on the specified entity.

Annotations
@SuppressWarnings:unchecked
Exceptions
IllegalArgumentException:
if managedEntity did not have managed or read-only status.
serializeback to summary
public void serialize(ObjectOutputStream oos) throws IOException

Serialize this UnresolvedEntityInsertActions object.

Parameters
oos:ObjectOutputStream

- the output stream

Exceptions
IOException:
if there is an error writing this object to the output stream.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override