org.sqlproc.engine.hibernate
Class HibernateSimpleSession

java.lang.Object
  extended by 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 the Session. It's the first parameter to all primary methods in the SqlQueryEngine and SqlCrudEngine.

The primary contract is the method for the SqlQuery instance creation.

For more info please see the Tutorials.

Author:
Vladimir Hudec

Field Summary
private  String name
          The name of the database related to this session.
private  org.hibernate.Session session
          The Hibernate Session, the first level cache and the context for all database operations.
 
Constructor Summary
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
 SqlQuery createSqlQuery(String queryString)
          
 int[] executeBatch(String[] statements)
          
 String getName()
           
 org.hibernate.Session getSession()
          Returns the internal Hibernate Session instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

private final 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 instance
name - 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

createSqlQuery

public SqlQuery createSqlQuery(String queryString)
                        throws SqlProcessorException

Specified by:
createSqlQuery in interface SqlSession
Throws:
SqlProcessorException

executeBatch

public int[] executeBatch(String[] statements)
                   throws SqlProcessorException

Specified by:
executeBatch in interface SqlSession
Throws:
SqlProcessorException

getName

public String getName()
Specified by:
getName in interface SqlSession
Returns:
the name of the database related to this session. It's usage is implementation specific.


Copyright © 2013. All Rights Reserved.