JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.aspects.hibernate
Class HibernateHelper

java.lang.Object
  |
  +--org.objectweb.jac.aspects.hibernate.HibernateHelper

public class HibernateHelper
extends Object

This class acts as a gateway between the AC HibernateAC and the Hibernate 2.0 framework. This class manages a singleton instance of itself.

Version:
1.0
Author:
Lionel Seinturier

Constructor Summary
HibernateHelper()
           
 
Method Summary
 void addClass(Class cl)
          Add a class to the Hibernate configuration.
static HibernateHelper get()
           
 net.sf.hibernate.Session getSession()
           
 net.sf.hibernate.Transaction getTx()
           
 void openSessionAndBeginTx()
          Open an Hibernate session, and start a transaction.
 void schemaExport()
          Export to the database the table schema for persistent classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateHelper

public HibernateHelper()
Method Detail

get

public static HibernateHelper get()
Returns:
the singleton instance of this class

addClass

public void addClass(Class cl)
              throws net.sf.hibernate.MappingException
Add a class to the Hibernate configuration. Given a class named apackage.ClassA, this triggers the loading of the property /apackage/ClassA..hbm.xml

net.sf.hibernate.MappingException

schemaExport

public void schemaExport()
                  throws net.sf.hibernate.HibernateException
Export to the database the table schema for persistent classes.

net.sf.hibernate.HibernateException

openSessionAndBeginTx

public void openSessionAndBeginTx()
                           throws net.sf.hibernate.HibernateException
Open an Hibernate session, and start a transaction. Users call session.save() or session.load() any number of times, commit or rollback the transaction, and close the session.

net.sf.hibernate.HibernateException

getSession

public net.sf.hibernate.Session getSession()

getTx

public net.sf.hibernate.Transaction getTx()
                                   throws net.sf.hibernate.HibernateException
net.sf.hibernate.HibernateException

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli