public class HibernateSession extends Object implements InvocationHandler
Session.
It's the first parameter to all primary methods in the SqlQueryEngine and SqlCrudEngine.
The implementation is based on the dynamic proxy design pattern provided by the Java API.
The primary contract is the method for the SqlQuery instance creation.
For more info please see the Tutorials.
| Modifier and Type | Field and Description |
|---|---|
private String |
name
The name of the database related to this session.
|
private static Class[] |
PROXY_INTERFACES
The contracts implemented by this dynamic proxy.
|
private org.hibernate.Session |
session
The Hibernate Session, the first level cache and the context for all database operations.
|
| Modifier | Constructor and Description |
|---|---|
private |
HibernateSession(org.hibernate.Session session)
Creates a new instance of this dynamic proxy.
|
|
HibernateSession(org.hibernate.Session session,
String name)
Creates a new instance of this dynamic proxy.
|
| Modifier and Type | Method and Description |
|---|---|
static SqlSession |
generateProxy(org.hibernate.Session session)
The factory method to obtain this dynamic proxy.
|
static SqlSession |
generateProxy(org.hibernate.Session session,
String name)
The factory method to obtain this dynamic proxy.
|
static ClassLoader |
getProxyClassLoader()
Returns the class loader instance.
|
Object |
invoke(Object proxy,
Method method,
Object[] args) |
private static final Class[] PROXY_INTERFACES
private org.hibernate.Session session
private String name
private HibernateSession(org.hibernate.Session session)
session - the Hibernate Session instancepublic HibernateSession(org.hibernate.Session session,
String name)
session - the Hibernate Session instancename - the name of the databasepublic Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke in interface InvocationHandlerThrowablepublic static SqlSession generateProxy(org.hibernate.Session session)
session - the Hibernate Session instancepublic static SqlSession generateProxy(org.hibernate.Session session, String name)
session - the Hibernate Session instancename - the name of the databasepublic static ClassLoader getProxyClassLoader()
Copyright © 2017. All rights reserved.