Package ome.tools.hibernate
Class SessionFactory
- java.lang.Object
-
- ome.tools.hibernate.SessionFactory
-
- All Implemented Interfaces:
org.aopalliance.aop.Advice
,org.aopalliance.intercept.Interceptor
,org.aopalliance.intercept.MethodInterceptor
public class SessionFactory extends java.lang.Object implements org.aopalliance.intercept.MethodInterceptor
Simple source of Thread-awareSession
instances. Wraps a call toSessionFactoryUtils
. Should be safe to call from within any service implementation call or inside of Executor.execute.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description SessionFactory(org.hibernate.SessionFactory factory, ome.util.SqlAction isolatedSqlAction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.hibernate.Session
getSession()
Returns a session active for the current thread.java.lang.Object
invoke(org.aopalliance.intercept.MethodInvocation mi)
Wraps all invocations to Session to prevent certain usages.
-
-
-
Method Detail
-
getSession
public org.hibernate.Session getSession()
Returns a session active for the current thread. The returned instance will be wrapped with AOP to prevent certain usage.- Returns:
- a wrapped active Hibernate session
- See Also:
- Trac ticket #73
-
invoke
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation mi) throws java.lang.Throwable
Wraps all invocations to Session to prevent certain usages. Note:QueryBuilder
may unwrap the session in certain cases.- Specified by:
invoke
in interfaceorg.aopalliance.intercept.MethodInterceptor
- Throws:
java.lang.Throwable
-
-