[JBoss Seam] - Re: How to return to a previous page without conversations
by christian.bauer@jboss.com
That sounds pretty much like the Seam Conversation scope, although much narrower and more focused on a particular use case. You can use the same examples and put it in Conversation scope - and then handle conversation propagation independently in your navigation rules.
We have a quite complete model and the machinery for all of this already, what we need in Seam is the notion of entry points of conversations and the ability to return to that entry point at the end of a conversation or for a particular outcome during the conversation.
Right now there are several disjunct facilities in Seam for this (the Redirect component covers half of these cases, Conversation.redirect() can return you to the last view of the parent conversation from a nested conversation) that need to be unified, extended, and tied into the metadata.
So right now I do the polymorphic "exit a conversation correctly, no matter if it's nested or a root conversation" manually:
| public void exitConversation(Boolean endBeforeRedirect) {
| Conversation currentConversation = Conversation.instance();
| if (currentConversation.isNested()) {
| // End this nested conversation and return to last rendered view-id of parent
| currentConversation.endAndRedirect(endBeforeRedirect);
| } else {
| // Always end this conversation
| currentConversation.end();
|
| ConversationEntry entryPoint =
| (ConversationEntry)Contexts.getConversationContext().get("conversationEntryPoint");
| if (entryPoint != null) {
| // We came here from another conversation
| if (entryPoint.isDisplayable()) {
| entryPoint.switchConversation();
| } else {
| // The entry point is gone... What now? Go to start page...
| Manager.instance().redirect("/display.xhtml", new HashMap<String,Object>(), true);
| }
| } else {
| // We came here from a non-conversational page
| if (endBeforeRedirect)
| redirectToLastBrowsedPage();
| else
| redirectToLastBrowsedPageWithConversation();
| }
| }
| }
|
I have to remember my entry points manually and return to them, see "conversationEntryPoint" and the mysterious redirectTo*() methods that do what I described earlier.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035408#4035408
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035408
19 years
[JBoss Seam] - Re: seam-gen and @GeneratedValue
by anarinsky
Andy,
I have the same problem with generated entities.
Did you find any workaround?
My database was generated by Hibernate using org.hibernate.tool.hbm2ddl.SchemaExportTask
Id supposed to be auto generated. However, when I add @GeneratedValue to the Id getter I am getting the exception on startup:
ObjectName: persistence.units:ear=spot4.ear,unitName=spot4
State: FAILED
Reason: javax.persistence.PersistenceException: org.hibernate.HibernateException: Missing sequence or table: hibernate_sequence
I Depend On:
jboss.jca:service=DataSourceBinding,name=spot4Datasource
With the old variant of Hibernate this auto sequence generated worked with the following annotation used in Doclet:
/**
* @hibernate.id column="ID" generator-class="increment" unsaved-value="0"
*/
Thank you!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035400#4035400
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035400
19 years