Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/xml/merge/inherited/EntityMappingsMergeInheritedJUnitTestCase.java =================================================================== --- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/xml/merge/inherited/EntityMappingsMergeInheritedJUnitTestCase.java (revision 3842) +++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/xml/merge/inherited/EntityMappingsMergeInheritedJUnitTestCase.java (working copy) @@ -22,12 +22,12 @@ import junit.framework.*; import org.eclipse.persistence.sessions.DatabaseSession; +import org.eclipse.persistence.testing.framework.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.xml.merge.inherited.Alpine; import org.eclipse.persistence.testing.models.jpa.xml.merge.inherited.BeerConsumer; import org.eclipse.persistence.testing.models.jpa.xml.merge.inherited.Canadian; import org.eclipse.persistence.testing.models.jpa.xml.merge.inherited.Certification; -import org.eclipse.persistence.testing.framework.junit.JUnitTestCase; -import org.eclipse.persistence.testing.models.jpa.inherited.Beer; +import org.eclipse.persistence.testing.models.jpa.xml.merge.inherited.Beer; import org.eclipse.persistence.testing.models.jpa.xml.merge.inherited.BeerListener; import org.eclipse.persistence.testing.models.jpa.xml.merge.inherited.EmbeddedSerialNumber; import org.eclipse.persistence.testing.models.jpa.xml.merge.inherited.TelephoneNumber; Index: jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/listeners/EntityClassListenerMetadata.java =================================================================== --- jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/listeners/EntityClassListenerMetadata.java (revision 3842) +++ jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/listeners/EntityClassListenerMetadata.java (working copy) @@ -18,6 +18,7 @@ import java.util.List; +import org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor; import org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor; import org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor; @@ -30,6 +31,7 @@ */ public class EntityClassListenerMetadata extends EntityListenerMetadata { private EntityAccessor m_accessor; + private MetadataDescriptor m_descriptor; /** * INTERNAL: @@ -38,6 +40,7 @@ super(null, null, accessor.getAccessibleObject()); m_accessor = accessor; + m_descriptor = accessor.getDescriptor(); // Set any XML defined call back method names. setPostLoad(accessor.getPostLoad()); @@ -58,19 +61,19 @@ // Process the callback methods as defined in XML or annotations on the // entity class first. - processCallbackMethods(getDeclaredMethods(m_accessor.getJavaClass()), m_accessor.getLogger()); + processCallbackMethods(getDeclaredMethods(m_accessor.getJavaClass()), m_descriptor); // Process the callback methods as defined in XML or annotations // on the mapped superclasses if not excluded second. - if (! m_accessor.getDescriptor().excludeSuperclassListeners()) { + if (! m_descriptor.excludeSuperclassListeners()) { for (MappedSuperclassAccessor mappedSuperclass : mappedSuperclasses) { - processCallbackMethods(getDeclaredMethods(mappedSuperclass.getJavaClass()), m_accessor.getLogger()); + processCallbackMethods(getDeclaredMethods(mappedSuperclass.getJavaClass()), m_descriptor); } } // Add the listener only if we actually found callback methods. if (m_listener.hasCallbackMethods()) { - m_accessor.getDescriptor().setEntityEventListener(m_listener); + m_descriptor.setEntityEventListener(m_listener); } } } Index: jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/listeners/EntityListenerMetadata.java =================================================================== --- jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/listeners/EntityListenerMetadata.java (revision 3842) +++ jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/listeners/EntityListenerMetadata.java (working copy) @@ -33,7 +33,6 @@ import org.eclipse.persistence.exceptions.ValidationException; import org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor; -import org.eclipse.persistence.internal.jpa.metadata.MetadataLogger; import org.eclipse.persistence.internal.jpa.metadata.ORMetadata; import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject; @@ -315,7 +314,7 @@ m_listener = new EntityListener(getClassForName(m_entityListenerClass.getName(), loader), descriptor.getJavaClass()); // Process the callback methods defined from XML and annotations. - processCallbackMethods(getCandidateCallbackMethodsForEntityListener(), descriptor.getLogger()); + processCallbackMethods(getCandidateCallbackMethodsForEntityListener(), descriptor); // Add the listener to the descriptor. if (isDefaultListener) { @@ -329,7 +328,7 @@ * INTERNAL: * Process the XML defined call back methods. */ - protected void processCallbackMethods(Method[] methods, MetadataLogger logger) { + protected void processCallbackMethods(Method[] methods, MetadataDescriptor descriptor) { // 1 - Set the XML specified methods first. if (m_postLoad != null) { setPostLoad(getCallbackMethod(m_postLoad, methods)); @@ -361,33 +360,33 @@ // 2 - Set any annotation defined methods second. for (Method method : methods) { - MetadataMethod metadataMethod = new MetadataMethod(method, logger); + MetadataMethod metadataMethod = new MetadataMethod(method, descriptor.getLogger()); - if (metadataMethod.isAnnotationPresent(PostLoad.class)) { + if (metadataMethod.isAnnotationPresent(PostLoad.class, descriptor)) { setPostLoad(method); } - if (metadataMethod.isAnnotationPresent(PostPersist.class)) { + if (metadataMethod.isAnnotationPresent(PostPersist.class, descriptor)) { setPostPersist(method); } - if (metadataMethod.isAnnotationPresent(PostRemove.class)) { + if (metadataMethod.isAnnotationPresent(PostRemove.class, descriptor)) { setPostRemove(method); } - if (metadataMethod.isAnnotationPresent(PostUpdate.class)) { + if (metadataMethod.isAnnotationPresent(PostUpdate.class, descriptor)) { setPostUpdate(method); } - if (metadataMethod.isAnnotationPresent(PrePersist.class)) { + if (metadataMethod.isAnnotationPresent(PrePersist.class, descriptor)) { setPrePersist(method); } - if (metadataMethod.isAnnotationPresent(PreRemove.class)) { + if (metadataMethod.isAnnotationPresent(PreRemove.class, descriptor)) { setPreRemove(method); } - if (metadataMethod.isAnnotationPresent(PreUpdate.class)) { + if (metadataMethod.isAnnotationPresent(PreUpdate.class, descriptor)) { setPreUpdate(method); } }