com.elasticpath.persistence.impl
Class HibernateSessionImpl

java.lang.Object
  extended by com.elasticpath.persistence.impl.HibernateSessionImpl
All Implemented Interfaces:
PersistenceSession

public class HibernateSessionImpl
extends java.lang.Object
implements PersistenceSession

The hibernate implementation of a Session in ElasticPath. It is a wrap of org.hibernate.Session.


Constructor Summary
HibernateSessionImpl(org.hibernate.Session session)
          The default constructor.
 
Method Summary
 Transaction beginTransaction()
          Begins a transaction.
 void close()
          Close the session.
 Query createQuery(java.lang.String queryString)
          Creates and returns a query based on the given query string.
 Query createSQLQuery(java.lang.String queryString)
          Creates and returns a query based on the given query string.
 void save(Persistence object)
          Save the given object.
 void update(Persistence object)
          Update the given object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateSessionImpl

public HibernateSessionImpl(org.hibernate.Session session)
The default constructor.

Parameters:
session - the hibernate session to wrap
Method Detail

beginTransaction

public Transaction beginTransaction()
                             throws EpPersistenceException
Begins a transaction.

Specified by:
beginTransaction in interface PersistenceSession
Returns:
returns a transaction
Throws:
EpPersistenceException - in case of any error

close

public void close()
           throws EpPersistenceException
Close the session.

Specified by:
close in interface PersistenceSession
Throws:
EpPersistenceException - in case of any error

createQuery

public Query createQuery(java.lang.String queryString)
                  throws EpPersistenceException
Creates and returns a query based on the given query string.

Specified by:
createQuery in interface PersistenceSession
Parameters:
queryString - the query string
Returns:
a query
Throws:
EpPersistenceException - in case of any error

createSQLQuery

public Query createSQLQuery(java.lang.String queryString)
                     throws EpPersistenceException
Creates and returns a query based on the given query string.

Specified by:
createSQLQuery in interface PersistenceSession
Parameters:
queryString - the query string
Returns:
a query
Throws:
EpPersistenceException - in case of any error

save

public void save(Persistence object)
          throws EpPersistenceException
Save the given object.

Specified by:
save in interface PersistenceSession
Parameters:
object - the object
Throws:
EpPersistenceException - in case of any error

update

public void update(Persistence object)
            throws EpPersistenceException
Update the given object.

Specified by:
update in interface PersistenceSession
Parameters:
object - the object
Throws:
EpPersistenceException - in case of any error