|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.orchestra.conversation.PersistentBackingBean
public class PersistentBackingBean
A backing bean for a view (ie a "view controller") that has an associated persistence context.
In real applications, the PersistenceContext is more likely to be on a DAO bean referenced from the backing bean than directly on the backing bean class. However that doesn't change the principles.
Constructor Summary | |
---|---|
PersistentBackingBean()
|
Method Summary | |
---|---|
UserData |
createUser()
Create a UserData object and commit it to the database. |
UserData |
getRestartedUser()
|
void |
invalidateAndRestartConversation()
Invalidate the conversation in which this bean lives, and then create a new bean instance (in a new conversation) and copy some data from the old to the new instance. |
void |
invalidateConversation()
Invalidate the conversation in which this bean lives. |
UserData |
readUser(Long id)
|
void |
setRestartedUser(Long id)
|
void |
updateUser(Long id,
String username)
|
void |
valueBound(ConversationBindingEvent event)
|
void |
valueUnbound(ConversationBindingEvent event)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PersistentBackingBean()
Method Detail |
---|
public void valueBound(ConversationBindingEvent event)
valueBound
in interface ConversationBindingListener
public void valueUnbound(ConversationBindingEvent event)
valueUnbound
in interface ConversationBindingListener
public UserData getRestartedUser()
@Transactional public UserData createUser()
Because this method is marked with the Transactional annotation, a commit will be performed when the method returns successfully (without exception), and a rollback will be performed when the method throws an exception.
public UserData readUser(Long id)
public void invalidateConversation()
This means that the next attempt to dereference a proxy or EL expression will cause a new instance of this bean to be created. A new Conversation instance will be created to hold that bean, and a new PersistenceContext object will also be created (and then injected into this instance).
public void invalidateAndRestartConversation()
Using invalidateAndRestart allows information to be communicated between one instance of this bean and its replacement.
public void setRestartedUser(Long id)
public void updateUser(Long id, String username)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |