org.jboss.seam.framework
Class HibernateEntityHome<E>

java.lang.Object
  extended by org.jboss.seam.framework.Controller
      extended by org.jboss.seam.framework.PersistenceController<T>
          extended by org.jboss.seam.framework.MutableController<T>
              extended by org.jboss.seam.framework.Home<org.hibernate.Session,E>
                  extended by org.jboss.seam.framework.HibernateEntityHome<E>
All Implemented Interfaces:
Serializable, Mutable

public class HibernateEntityHome<E>
extends Home<org.hibernate.Session,E>

Base class for Home objects for Hibernate entities.

Author:
Gavin King
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.seam.framework.Home
instance, newInstance
 
Constructor Summary
HibernateEntityHome()
           
 
Method Summary
 void create()
          Run on Home instantiation to check the Home component is in a valid state.
 E find()
          Hook method called by Home.initInstance() to allow the implementation to load the entity from the Persistence Context.
protected  String getEntityName()
          Hook method to get the name of the managed entity
protected  String getPersistenceContextName()
           
 org.hibernate.Session getSession()
           
 boolean isManaged()
           
protected  void joinTransaction()
          Hook method called to allow the implementation to join the current transaction when necessary.
protected  E loadInstance()
           
 String persist()
           
 String remove()
           
 void setSession(org.hibernate.Session session)
           
 String update()
           
 
Methods inherited from class org.jboss.seam.framework.Home
assignId, clearInstance, createdMessage, createInstance, deletedMessage, getCreatedMessage, getCreatedMessageKey, getDeletedMessage, getDeletedMessageKey, getEntityClass, getId, getInstance, getMessageKeyPrefix, getNewInstance, getSimpleEntityName, getUpdatedMessage, getUpdatedMessageKey, handleNotFound, initInstance, isIdDefined, raiseAfterTransactionSuccessEvent, setCreatedMessage, setDeletedMessage, setEntityClass, setId, setInstance, setNewInstance, setUpdatedMessage, updatedMessage
 
Methods inherited from class org.jboss.seam.framework.MutableController
clearDirty, setDirty, setDirty
 
Methods inherited from class org.jboss.seam.framework.PersistenceController
getPersistenceContext, setPersistenceContext
 
Methods inherited from class org.jboss.seam.framework.Controller
addCookie, addFacesMessage, addFacesMessageFromResourceBundle, debug, debug, error, error, failValidation, fatal, fatal, getApplicationContext, getBusinessProcessContext, getComponentInstance, getComponentInstance, getConversation, getConversationContext, getCookie, getEventContext, getEvents, getFacesContext, getFacesMessages, getIdentity, getLog, getMessages, getMethodContext, getPageContext, getRedirect, getSessionContext, getValidator, getValidator, info, info, interpolate, invalidateSession, isTransactionMarkedRollback, raiseAsynchronousEvent, raiseEvent, raiseTransactionSuccessEvent, render, sendHttpError, sendHttpError, trace, trace, validationFailed, validationSucceeded, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateEntityHome

public HibernateEntityHome()
Method Detail

create

public void create()
Description copied from class: Home
Run on Home instantiation to check the Home component is in a valid state.
Validates that the class of the entity to be managed has been specified.

Overrides:
create in class Home<org.hibernate.Session,E>

isManaged

@Transactional
public boolean isManaged()

update

@Transactional
public String update()

persist

@Transactional
public String persist()

remove

@Transactional
public String remove()

find

@Transactional
public E find()
Description copied from class: Home
Hook method called by Home.initInstance() to allow the implementation to load the entity from the Persistence Context.

Overrides:
find in class Home<org.hibernate.Session,E>

loadInstance

protected E loadInstance()

joinTransaction

protected void joinTransaction()
Description copied from class: Home
Hook method called to allow the implementation to join the current transaction when necessary.

Overrides:
joinTransaction in class Home<org.hibernate.Session,E>

getSession

public org.hibernate.Session getSession()

setSession

public void setSession(org.hibernate.Session session)

getPersistenceContextName

protected String getPersistenceContextName()
Specified by:
getPersistenceContextName in class PersistenceController<org.hibernate.Session>

getEntityName

protected String getEntityName()
Description copied from class: Home
Hook method to get the name of the managed entity

Specified by:
getEntityName in class Home<org.hibernate.Session,E>