The Encog Project

org.encog.util.orm
Class ORMSession

java.lang.Object
  extended by org.encog.util.orm.ORMSession

public class ORMSession
extends java.lang.Object

A Hibernate session. This class provides access to the Hibernate persisted database.

Author:
jheaton

Constructor Summary
ORMSession(org.hibernate.Session session)
          Construct an ORMSession based on a Hibernate session.
 
Method Summary
 void begin()
          Begin the transaction.
 void clear()
          Clear the Hibernate session.
 void close()
          Close the session.
 void commit()
          Commit the transaction.
 org.hibernate.Query createQuery(java.lang.String sql)
          Create a HQL query.
 org.hibernate.Query createSQLQuery(java.lang.String sql)
          Create a Hibernate SQL query.
 void delete(java.lang.Object obj)
          Delete the specified persisted object.
 void evict(DataObject obj)
          Evict the specified object from the cache.
 void executeSQL(java.lang.String sql)
          Execute the specified SQL.
 void flush()
          Flush this session.
 void rollback()
          Rollback this transaction.
 void save(DataObject obj)
          Save the specified object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ORMSession

public ORMSession(org.hibernate.Session session)
Construct an ORMSession based on a Hibernate session.

Parameters:
session - The Hibernate session.
Method Detail

begin

public void begin()
Begin the transaction.


clear

public void clear()
Clear the Hibernate session.


close

public void close()
Close the session.


commit

public void commit()
Commit the transaction.


createQuery

public org.hibernate.Query createQuery(java.lang.String sql)
Create a HQL query.

Parameters:
sql - The HQL query.
Returns:
A Hibernate query.

createSQLQuery

public org.hibernate.Query createSQLQuery(java.lang.String sql)
Create a Hibernate SQL query.

Parameters:
sql - The SQL to query on.
Returns:
A Hibernate query.

delete

public void delete(java.lang.Object obj)
Delete the specified persisted object.

Parameters:
obj - The object to delete.

evict

public void evict(DataObject obj)
Evict the specified object from the cache.

Parameters:
obj - The object to evict.

executeSQL

public void executeSQL(java.lang.String sql)
Execute the specified SQL.

Parameters:
sql - The SQL to execute.

flush

public void flush()
Flush this session.


rollback

public void rollback()
Rollback this transaction.


save

public void save(DataObject obj)
Save the specified object.

Parameters:
obj - The persistant object to save.

The Encog Project