diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/MergeContext.java b/hibernate-core/src/main/java/org/hibernate/event/internal/MergeContext.java index a67b592c0b..4564d651a5 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/MergeContext.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/MergeContext.java @@ -17,57 +17,54 @@ import org.hibernate.event.spi.EventSource; import org.hibernate.pretty.MessageHelper; /** - * MergeContext is a Map implementation that is intended to be used by a merge - * event listener to keep track of each entity being merged and their corresponding - * managed result. Entities to be merged may to be added to the MergeContext before - * the merge operation has cascaded to that entity. - *
- * "Merge entity" and "mergeEntity" method parameter refer to an entity that is - * (or will be) merged via {@link EventSource#merge(Object mergeEntity)}. - *
- * "Managed entity" and "managedEntity" method parameter refer to the managed entity - * that is the result of merging an entity. - *
- * A merge entity can be transient, detached, or managed. If it is managed, then it - * must be the same as its associated entity result. + * {@code MergeContext} is a specialized {@link Map} implementation used by a + * {@linkplain org.hibernate.event.spi.MergeEventListener merge event listener} + * to keep track of each entity being merged and its corresponding managed result. + * An entity to be merged may to be added to the {@code MergeContext} before the + * merge operation cascades to the entity. + *
* If {@link #put(Object mergeEntity, Object managedEntity)} is called, and this - * MergeContext already contains an entry with a different entity as the key, but - * with the same (managedEntity) value, this means that multiple entity - * representations for the same persistent entity are being merged. If this happens, - * {@link EntityCopyObserver#entityCopyDetected( + * {@code MergeContext} already contains an entry with a different entity as the + * key, but with the same (managed entity) value, this means that multiple entity + * representations for the same persistent entity are being merged. In this + * situation, {@link EntityCopyObserver#entityCopyDetected( * Object managedEntity, Object mergeEntity1, Object mergeEntity2, EventSource)} - * will be called. It is up to that method to determine the property course of - * action for this situation. + * is called to determine an appropriate resolution. *
* There are several restrictions. *
* {@link MergeContext#put(Object mergeEntity, Object managedEntity, boolean isOperatedOn)} *
- * The following method is intended to be used by a merge event listener (and other - * classes) in the same package to indicate whether the merge operation is being - * performed on a merge entity already in the {@link MergeContext}: + * The following method is intended to be used by a {@code MergeEventListener} to + * indicate whether the merge operation is being performed on a merge entity already + * in the {@code MergeContext}: *
* {@link MergeContext#setOperatedOn(Object mergeEntity, boolean isOperatedOn)} * diff --git a/hibernate-core/src/main/java/org/hibernate/event/spi/EntityCopyObserver.java b/hibernate-core/src/main/java/org/hibernate/event/spi/EntityCopyObserver.java index 6afc7d4075..151d3192e0 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/spi/EntityCopyObserver.java +++ b/hibernate-core/src/main/java/org/hibernate/event/spi/EntityCopyObserver.java @@ -9,6 +9,8 @@ package org.hibernate.event.spi; /** * An observer for detection of multiple entity representations for a persistent entity being merged. * + * @see org.hibernate.event.internal.MergeContext + * * @author Gail Badner */ public interface EntityCopyObserver {