From c6d0cef046c31d3f79598f5341e429a338ed2682 Mon Sep 17 00:00:00 2001 From: Emmanuel Bernard Date: Mon, 5 Jul 2010 17:59:14 +0200 Subject: [PATCH] HHH-5879 Expose SessionFactory observer as SessionFactoryImplementor contract --- .../org/hibernate/engine/SessionFactoryImplementor.java | 7 +++++++ .../main/java/org/hibernate/impl/SessionFactoryImpl.java | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/core/src/main/java/org/hibernate/engine/SessionFactoryImplementor.java b/core/src/main/java/org/hibernate/engine/SessionFactoryImplementor.java index 23e2470918..1df9d78d00 100644 --- a/core/src/main/java/org/hibernate/engine/SessionFactoryImplementor.java +++ b/core/src/main/java/org/hibernate/engine/SessionFactoryImplementor.java @@ -36,6 +36,7 @@ import org.hibernate.Interceptor; import org.hibernate.MappingException; import org.hibernate.SessionFactory; import org.hibernate.ConnectionReleaseMode; +import org.hibernate.SessionFactoryObserver; import org.hibernate.proxy.EntityNotFoundDelegate; import org.hibernate.engine.query.QueryPlanCache; import org.hibernate.engine.profile.FetchProfile; @@ -244,4 +245,10 @@ public interface SessionFactoryImplementor extends Mapping, SessionFactory { */ public FetchProfile getFetchProfile(String name); + /** + * Return the SessionFactoryObserver attached to the SessionFactory if any + * @return + */ + public SessionFactoryObserver getFactoryObserver(); + } diff --git a/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java b/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java index ada9447f65..db7530d654 100644 --- a/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java +++ b/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java @@ -1275,6 +1275,10 @@ public final class SessionFactoryImpl implements SessionFactory, SessionFactoryI return ( FetchProfile ) fetchProfiles.get( name ); } + public SessionFactoryObserver getFactoryObserver() { + return observer; + } + public TypeHelper getTypeHelper() { return typeHelper; }