[jboss-user] [JBoss Seam] - Re: HowTo: When going to a page to enter data, pull from db

petemuir do-not-reply at jboss.com
Sat Apr 21 07:50:26 EDT 2007


"CptnKirk" wrote : @Unwrap - Method called on a component that allows the component to manage the creation of a contextual variable.  So Component ActivityManager might have an @Unwrap method that puts an Activity into scope referenceable by the EL #{activity}.  This method will be called every time the #{activity} variable is referenced or injected into a bean.  Because the @Unwrap annotation is on a method within a Seam Component, the component can take advantage of the entire Seam life cycle, including providing tear down logic.

@Unwrap is most useful for exposing a non-Seam service (e.g. a JavaMail Session) as a Seam component. Its unlikely you want to use it in your app (unless you are providing scafolding), @Factory is the one to use.

anonymous wrote : EntityHome - These are classes the provide generic DAO capabilities to objects.  By using an EntityHome you can Create, Update, Delete a single entity via its primary key.  In order to Update or Delete with an EntityHome you must pass the ID of the object to the EntityHome prior to calling update or remove.

Reading (quickly) the thread, I would suggest taking time to understand the Seam Application Framework as it sounds like you are trying to standard CRUD which it supports ootb.  The seamdiscs example is a good example of an app built using the framework (if you can put up with the trinidad and richfaces visual components)

anonymous wrote : EJB3 Entity Beans - Seam components that are EJB3 Entity Beans are automatically registered as event scoped components.  They have an implicit auto-create when used with JSF pages.  So you could @Name("activity") your Activity EJB3 entity bean.  And reference it in your JSF page as #{activity}.  Seam will call the default constructor and you'll be able to use EL to set values and can inject @In("activity") into the controller that deals with the form action.  Beans can have multiple names, and multiple scopes.  Read more about the @Role/@Roles annotation for more information. 

Not quite, they are only components if the have @Name (in which case they would be CONVERSATION scoped).  The "preferred" way to do this is to use Home objects to manage an Entity, rather than expose it directly with @Name, and uses pages.xml for wiring.   We could probably do with an example app built using Seam-gen that does a couple of simple CRUD operations

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039522#4039522

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039522



More information about the jboss-user mailing list