ReattachVisitorpublic abstract class ReattachVisitor extends ProxyVisitor Abstract superclass of visitors that reattach collections. |
Fields Summary |
---|
private static final Log | log | private final Serializable | ownerIdentifier | private final Object | owner |
Methods Summary |
---|
final java.io.Serializable | extractCollectionKeyFromOwner(org.hibernate.persister.collection.CollectionPersister role)This version is slightly different in that here we need to assume that
the owner is not yet associated with the session, and thus we cannot
rely on the owner's EntityEntry snapshot...
if ( role.getCollectionType().useLHSPrimaryKey() ) {
return ownerIdentifier;
}
else {
return ( Serializable ) role.getOwnerEntityPersister().getPropertyValue( owner, role.getCollectionType().getLHSPropertyName(), getSession().getEntityMode() );
}
| final java.lang.Object | getOwner()Retrieve the entity being visited.
return owner;
| final java.io.Serializable | getOwnerIdentifier()Retrieve the identifier of the entity being visited.
return ownerIdentifier;
| java.lang.Object | processComponent(java.lang.Object component, org.hibernate.type.AbstractComponentType componentType){@inheritDoc}
Type[] types = componentType.getSubtypes();
if ( component == null ) {
processValues( new Object[types.length], types );
}
else {
super.processComponent( component, componentType );
}
return null;
| void | removeCollection(org.hibernate.persister.collection.CollectionPersister role, java.io.Serializable collectionKey, org.hibernate.event.EventSource source)Schedules a collection for deletion.
if ( log.isTraceEnabled() ) {
log.trace(
"collection dereferenced while transient " +
MessageHelper.collectionInfoString( role, ownerIdentifier, source.getFactory() )
);
}
source.getActionQueue().addAction( new CollectionRemoveAction( null, role, collectionKey, false, source ) );
|
|