com.elasticpath.persistence
Interface PersistenceSession

All Known Implementing Classes:
HibernateSessionImpl

public interface PersistenceSession

The perisistence session interface. It provides more control than PersistenceEngine. For example, you can control the transaction programmatically.


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 sql query based on the given query string.
 void save(Persistence object)
          Save the given object.
 void update(Persistence object)
          Update the given object.
 

Method Detail

beginTransaction

Transaction beginTransaction()
                             throws EpPersistenceException
Begins a transaction.

Returns:
returns a transaction
Throws:
EpPersistenceException - in case of any error

close

void close()
           throws EpPersistenceException
Close the session.

Throws:
EpPersistenceException - in case of any error

createQuery

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

Parameters:
queryString - the query string
Returns:
a query
Throws:
EpPersistenceException - in case of any error

createSQLQuery

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

Parameters:
queryString - the query string
Returns:
a query
Throws:
EpPersistenceException - in case of any error

save

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

Parameters:
object - the object
Throws:
EpPersistenceException - in case of any error

update

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

Parameters:
object - the object
Throws:
EpPersistenceException - in case of any error