Package org.sqlproc.engine.hibernate
Class HibernateSimpleSession
- java.lang.Object
-
- org.sqlproc.engine.hibernate.HibernateSimpleSession
-
- All Implemented Interfaces:
SqlSession
public class HibernateSimpleSession extends Object implements SqlSession
The Hibernate stack implementation of the SQL Engine session contract. In fact it's a simple wrapper for theSession. It's the first parameter to all primary methods in theSqlQueryEngineandSqlCrudEngine.The primary contract is the method for the
SqlQueryinstance creation.For more info please see the Tutorials.
- Author:
- Vladimir Hudec
-
-
Constructor Summary
Constructors Constructor Description HibernateSimpleSession(org.hibernate.Session session)Creates a new instance of this dynamic proxy.HibernateSimpleSession(org.hibernate.Session session, String name)Creates a new instance of this dynamic proxy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SqlQuerycreateSqlQuery(String queryString)int[]executeBatch(String... statements)StringgetName()org.hibernate.SessiongetSession()Returns the internal Hibernate Session instance.voidsetSession(org.hibernate.Session session)Sets the internal Hibernate Session instance.
-
-
-
Field Detail
-
session
private org.hibernate.Session session
The Hibernate Session, the first level cache and the context for all database operations.
-
name
private String name
The name of the database related to this session. It's usage is implementation specific.
-
-
Constructor Detail
-
HibernateSimpleSession
public HibernateSimpleSession(org.hibernate.Session session)
Creates a new instance of this dynamic proxy.- Parameters:
session- the Hibernate Session instance
-
HibernateSimpleSession
public HibernateSimpleSession(org.hibernate.Session session, String name)Creates a new instance of this dynamic proxy.- Parameters:
session- the Hibernate Session instancename- the name of the database
-
-
Method Detail
-
getSession
public org.hibernate.Session getSession()
Returns the internal Hibernate Session instance.- Returns:
- the internal Hibernate Session instance
-
setSession
public void setSession(org.hibernate.Session session)
Sets the internal Hibernate Session instance.- Parameters:
session- the internal Hibernate Session instance
-
createSqlQuery
public SqlQuery createSqlQuery(String queryString) throws SqlProcessorException
- Specified by:
createSqlQueryin interfaceSqlSession- Throws:
SqlProcessorException
-
executeBatch
public int[] executeBatch(String... statements) throws SqlProcessorException
- Specified by:
executeBatchin interfaceSqlSession- Throws:
SqlProcessorException
-
getName
public String getName()
- Specified by:
getNamein interfaceSqlSession- Returns:
- the name of the database related to this session. It's usage is implementation specific.
-
-