org.controlhaus.hibernate
Class HibernateControlImpl

java.lang.Object
  extended by org.controlhaus.hibernate.HibernateControlImpl
All Implemented Interfaces:
HibernateControl

public class HibernateControlImpl
extends java.lang.Object
implements HibernateControl

Hibernate service.

Since:
May 10, 2003
Author:
Dan Diephouse

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.controlhaus.hibernate.HibernateControl
HibernateControl.HibernateInstance
 
Field Summary
(package private)  org.apache.beehive.controls.api.context.ControlBeanContext context
           
(package private)  org.apache.beehive.controls.api.context.ResourceContext resourceContext
           
 
Constructor Summary
HibernateControlImpl()
           
 
Method Summary
 void closeSession()
          Close the session for the current Thread.
 net.sf.hibernate.cfg.Configuration getConfiguration()
           
 java.lang.String getConfigurationLocation()
          Override this method to provide logic on how to get the Hibernate configuration file.
 java.lang.String getHibernateInstance()
          The instance of hibernate that you want this control to use.
 net.sf.hibernate.Session getSession()
          Return the session that is currently associated with this Thread.
 net.sf.hibernate.SessionFactory getSessionFactory()
          Get the Hibernate SessionFactory.
 void onAcquire()
           
 void onRelease()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

org.apache.beehive.controls.api.context.ControlBeanContext context

resourceContext

org.apache.beehive.controls.api.context.ResourceContext resourceContext
Constructor Detail

HibernateControlImpl

public HibernateControlImpl()
Method Detail

getSessionFactory

public net.sf.hibernate.SessionFactory getSessionFactory()
Description copied from interface: HibernateControl
Get the Hibernate SessionFactory.

Specified by:
getSessionFactory in interface HibernateControl
Returns:
See Also:
org.codehaus.plexus.hibernate.HibernateService#getSessionFactory()

getConfiguration

public net.sf.hibernate.cfg.Configuration getConfiguration()

getConfigurationLocation

public java.lang.String getConfigurationLocation()
Description copied from interface: HibernateControl
Override this method to provide logic on how to get the Hibernate configuration file. This can be a file or a resource on the classpath.

Specified by:
getConfigurationLocation in interface HibernateControl
Returns:

getHibernateInstance

public java.lang.String getHibernateInstance()
Description copied from interface: HibernateControl
The instance of hibernate that you want this control to use. This will be "default" unless you use the HibernateInstance annotation to override it.

Specified by:
getHibernateInstance in interface HibernateControl
Returns:

onAcquire

public void onAcquire()

onRelease

public void onRelease()

getSession

public net.sf.hibernate.Session getSession()
                                    throws net.sf.hibernate.HibernateException
Description copied from interface: HibernateControl
Return the session that is currently associated with this Thread.

Specified by:
getSession in interface HibernateControl
Returns:
Throws:
net.sf.hibernate.HibernateException

closeSession

public void closeSession()
                  throws net.sf.hibernate.HibernateException
Description copied from interface: HibernateControl
Close the session for the current Thread.

Specified by:
closeSession in interface HibernateControl
Throws:
net.sf.hibernate.HibernateException


Copyright © 2004 Controlhaus. All Rights Reserved.