diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/EntityCopyAllowedLoggedObserver.java b/hibernate-core/src/main/java/org/hibernate/event/internal/EntityCopyAllowedLoggedObserver.java index 9fb087a359..3677b51c27 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/EntityCopyAllowedLoggedObserver.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/EntityCopyAllowedLoggedObserver.java @@ -28,8 +28,9 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; +import org.jboss.logging.Logger; + import org.hibernate.event.spi.EventSource; -import org.hibernate.internal.CoreLogging; import org.hibernate.internal.CoreMessageLogger; import org.hibernate.internal.util.collections.IdentitySet; import org.hibernate.pretty.MessageHelper; @@ -42,7 +43,9 @@ import org.hibernate.pretty.MessageHelper; * @author Gail Badner */ public class EntityCopyAllowedLoggedObserver extends EntityCopyAllowedObserver { - private static final CoreMessageLogger LOG = CoreLogging.messageLogger( EntityCopyAllowedLoggedObserver.class ); + private static final CoreMessageLogger LOG = Logger.getMessageLogger( + CoreMessageLogger.class, EntityCopyAllowedLoggedObserver.class.getName() + ); // Tracks the number of entity copies per entity name. private Map countsByEntityName; diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/EntityCopyAllowedObserver.java b/hibernate-core/src/main/java/org/hibernate/event/internal/EntityCopyAllowedObserver.java index 4f12f3424d..cdb54dbc31 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/EntityCopyAllowedObserver.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/EntityCopyAllowedObserver.java @@ -23,15 +23,7 @@ */ package org.hibernate.event.internal; -import java.util.IdentityHashMap; -import java.util.Map; -import java.util.Set; - import org.hibernate.event.spi.EventSource; -import org.hibernate.internal.CoreLogging; -import org.hibernate.internal.CoreMessageLogger; -import org.hibernate.internal.util.collections.IdentitySet; -import org.hibernate.pretty.MessageHelper; /** * An {@link EntityCopyObserver} implementation that allows multiple representations of diff --git a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/event/internal/core/JpaEntityCopyAllowedMergeEventListener.java b/hibernate-entitymanager/src/main/java/org/hibernate/ejb/event/EJB3EntityCopyAllowedMergeEventListener.java similarity index 87% rename from hibernate-entitymanager/src/main/java/org/hibernate/jpa/event/internal/core/JpaEntityCopyAllowedMergeEventListener.java rename to hibernate-entitymanager/src/main/java/org/hibernate/ejb/event/EJB3EntityCopyAllowedMergeEventListener.java index cba9b1c6eb..72ddc20bf9 100644 --- a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/event/internal/core/JpaEntityCopyAllowedMergeEventListener.java +++ b/hibernate-entitymanager/src/main/java/org/hibernate/ejb/event/EJB3EntityCopyAllowedMergeEventListener.java @@ -21,19 +21,19 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.jpa.event.internal.core; +package org.hibernate.ejb.event; import org.hibernate.event.internal.EntityCopyAllowedLoggedObserver; import org.hibernate.event.internal.EntityCopyAllowedObserver; import org.hibernate.event.internal.EntityCopyObserver; /** - * Overrides {@link JpaMergeEventListener} that allows merging multiple representations + * Overrides {@link EJB3MergeEventListener} that allows merging multiple representations * of the same persistent entity. * * @author Gail Badner */ -public class JpaEntityCopyAllowedMergeEventListener extends JpaMergeEventListener { +public class EJB3EntityCopyAllowedMergeEventListener extends EJB3MergeEventListener { @Override protected EntityCopyObserver createEntityCopyObserver() { diff --git a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/Category.java b/hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/Category.java similarity index 98% rename from hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/Category.java rename to hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/Category.java index 1797ee16dc..8e161b902c 100644 --- a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/Category.java +++ b/hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/Category.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.jpa.test.emops; +package org.hibernate.ejb.test.emops; import javax.persistence.CascadeType; import javax.persistence.Entity; diff --git a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/Hoarder.java b/hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/Hoarder.java similarity index 98% rename from hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/Hoarder.java rename to hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/Hoarder.java index 3ffab53036..6a0ee0663a 100644 --- a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/Hoarder.java +++ b/hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/Hoarder.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.jpa.test.emops; +package org.hibernate.ejb.test.emops; import java.util.HashSet; import java.util.Set; diff --git a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/Item.java b/hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/Item.java similarity index 98% rename from hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/Item.java rename to hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/Item.java index f92ac25436..21d7e430f2 100644 --- a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/Item.java +++ b/hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/Item.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.jpa.test.emops; +package org.hibernate.ejb.test.emops; import javax.persistence.CascadeType; import javax.persistence.Entity; diff --git a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/MergeMultipleEntityRepresentationsAllowedTest.java b/hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/MergeMultipleEntityRepresentationsAllowedTest.java similarity index 90% rename from hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/MergeMultipleEntityRepresentationsAllowedTest.java rename to hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/MergeMultipleEntityRepresentationsAllowedTest.java index 95e0901c7a..2388cad9b5 100644 --- a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/MergeMultipleEntityRepresentationsAllowedTest.java +++ b/hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/MergeMultipleEntityRepresentationsAllowedTest.java @@ -21,18 +21,20 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.jpa.test.emops; +package org.hibernate.ejb.test.emops; import java.util.List; import javax.persistence.EntityManager; import org.junit.Test; +import org.hibernate.SessionFactory; +import org.hibernate.ejb.HibernateEntityManagerFactory; +import org.hibernate.ejb.event.EJB3EntityCopyAllowedMergeEventListener; +import org.hibernate.ejb.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.event.service.spi.EventListenerRegistry; import org.hibernate.event.spi.EventType; -import org.hibernate.jpa.event.internal.core.JpaEntityCopyAllowedMergeEventListener; -import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.testing.TestForIssue; import static org.junit.Assert.assertFalse; @@ -42,7 +44,7 @@ import static org.junit.Assert.assertSame; /** * Tests merging multiple detached representations of the same entity using - * {@link org.hibernate.jpa.event.internal.core.JpaEntityCopyAllowedMergeEventListener}. + * {@link org.hibernate.ejb.event.EJB3EntityCopyAllowedMergeEventListener}. * * @author Gail Badner */ @@ -52,10 +54,10 @@ public class MergeMultipleEntityRepresentationsAllowedTest extends BaseEntityMan @Override protected void afterEntityManagerFactoryBuilt() { super.afterEntityManagerFactoryBuilt(); - - SessionFactoryImplementor sfi = entityManagerFactory().unwrap( SessionFactoryImplementor.class ); - EventListenerRegistry registry = sfi.getServiceRegistry().getService( EventListenerRegistry.class ); - registry.setListeners( EventType.MERGE, new JpaEntityCopyAllowedMergeEventListener() ); + SessionFactory sf = ( (HibernateEntityManagerFactory) entityManagerFactory() ).getSessionFactory(); + EventListenerRegistry registry = + ( (SessionFactoryImplementor) sf ).getServiceRegistry().getService( EventListenerRegistry.class ); + registry.setListeners( EventType.MERGE, new EJB3EntityCopyAllowedMergeEventListener() ); } @Test diff --git a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/MergeMultipleEntityRepresentationsNotAllowedTest.java b/hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/MergeMultipleEntityRepresentationsNotAllowedTest.java similarity index 97% rename from hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/MergeMultipleEntityRepresentationsNotAllowedTest.java rename to hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/MergeMultipleEntityRepresentationsNotAllowedTest.java index cc6560dbb4..09432ddcd9 100644 --- a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/emops/MergeMultipleEntityRepresentationsNotAllowedTest.java +++ b/hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/emops/MergeMultipleEntityRepresentationsNotAllowedTest.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.jpa.test.emops; +package org.hibernate.ejb.test.emops; import java.util.List; @@ -29,7 +29,7 @@ import javax.persistence.EntityManager; import org.junit.Test; -import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; +import org.hibernate.ejb.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.testing.TestForIssue; import static junit.framework.TestCase.fail;