|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.seam.framework.Controller org.jboss.seam.framework.PersistenceController<T> org.jboss.seam.framework.MutableController<T> org.jboss.seam.framework.Home<javax.persistence.EntityManager,E> org.jboss.seam.framework.EntityHome<E>
public class EntityHome<E>
Base class for Home objects of JPA entities.
Field Summary |
---|
Fields inherited from class org.jboss.seam.framework.Home |
---|
instance, newInstance |
Constructor Summary | |
---|---|
EntityHome()
|
Method Summary | |
---|---|
void |
create()
Run on EntityHome instantiation. |
E |
find()
Implementation of find() for JPA |
javax.persistence.EntityManager |
getEntityManager()
The Seam Managed Persistence Context used by this Home component |
protected String |
getEntityName()
Implementation of getEntityName() for JPA |
protected String |
getPersistenceContextName()
The name the Seam component managing the Persistence Context. |
boolean |
isManaged()
Returns true if the entity instance is managed |
protected void |
joinTransaction()
Implementation of joinTransaction() for
JPA. |
protected E |
loadInstance()
Utility method to load entity instance from the EntityManager . |
String |
persist()
Persist unmanaged entity instance to the underlying database. |
String |
remove()
Remove managed entity instance from the Persistence Context and the underlying database. |
void |
setEntityManager(javax.persistence.EntityManager entityManager)
The Seam Managed Persistence Context used by this Home component. |
String |
update()
Flush any changes made to the managed entity instance to the underlying database. |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EntityHome()
Method Detail |
---|
public void create()
EntityHome
instantiation.
EntityManager
is available.
create
in class Home<javax.persistence.EntityManager,E>
Home.create()
@Transactional public boolean isManaged()
@Transactional public String update()
FacesMessage
is added and a transaction
success event raised.
Home.updatedMessage()
,
Home.raiseAfterTransactionSuccessEvent()
@Transactional public String persist()
FacesMessage
is added and a transaction
success event raised.
Home.createdMessage()
,
Home.raiseAfterTransactionSuccessEvent()
@Transactional public String remove()
FacesMessage
is added and a transaction
success event raised.
Home.deletedMessage()
,
Home.raiseAfterTransactionSuccessEvent()
@Transactional public E find()
find()
for JPA
find
in class Home<javax.persistence.EntityManager,E>
Home.find()
protected E loadInstance()
EntityManager
.
Called by find()
.
getEntityClass()
,
getId()
protected void joinTransaction()
joinTransaction()
for
JPA.
joinTransaction
in class Home<javax.persistence.EntityManager,E>
public javax.persistence.EntityManager getEntityManager()
public void setEntityManager(javax.persistence.EntityManager entityManager)
protected String getPersistenceContextName()
getEntityManager()
if your persistence context
is not named entityManager
.
getPersistenceContextName
in class PersistenceController<javax.persistence.EntityManager>
protected String getEntityName()
getEntityName()
for JPA
getEntityName
in class Home<javax.persistence.EntityManager,E>
Home.getEntityName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |