[JBoss Seam] - Re: Complex Search Results - return object identifiers inste
by jfrankman
My entity bean has session scope:
@Table(name="FBCLIENT",schema="DB2ADMIN")
| @Name("client")
| @Scope(ScopeType.SESSION)
| public class ClientVO implements Serializable
| {
| private static final long serialVersionUID = 2285612284592204149L;
|
| private Long id;
| private String notes;
| private String clientType;
| private String memberNumber;
| private Set<ClientLocationVO> entityLocations = new HashSet<ClientLocationVO>();
| private Set<PolicyVO> policies = new HashSet<PolicyVO>();
| private String search;
| private DrivingDistance drivingDistance;
| private String homePhone;
| private String workPhone;
| private String cellPhone;
| private String pagerNo;
| private String email;
| private ClientVO parentClient;
| private List<ClientVO> clientMembers=new ArrayList<ClientVO>();
|
| /**
| * @return the childMembers
| */
|
|
| @OneToMany(mappedBy="parentClient",fetch=FetchType.LAZY)
| public List<ClientVO> getClientMembers() {
| return clientMembers;
| }
|
| /**
| * @return the parentClient
| */
|
| @ManyToOne()
| @JoinColumn (name="parentclientid" )
| public ClientVO getParentClient() {
| return parentClient;
| }
| ....
When I perform the search I do not use a conversation, just a stateless session bean:
@Stateless
| @Name("search")
| public class SearchAction implements Search
| {
| @In Identity identity;
|
| @In private SearchVO searchvo;
| @In(create=true) private ClientService clientService;
| @In(create=true) private PolicyService policyService;
|
|
| @In(required=false)
| private FBWorker worker;
|
| @Out(required=false) private PolicyVO policy;
| public String performNameSearch()
| {
|
| searchResults = policyService.findPolicyHoldersByNameIncludeSubclients(searchvo.getSearchString());
|
| searchvo.setSearchResults(searchResults);
| return "success";
| }
|
| ...
When the user clicks the row in the datatable I then try and load the entire object by calling the lookupClientFromSearch method on my ClientAction stateful bean. :
<h:commandLink value="#{searchResult.clientVO.fullName}" action="#{clientAction.lookupClientFromSearch}"/>
Inside the lookupclientFromSearch I am using a conversation:
@Stateful
| @Name("clientAction")
| public class ClientActionImpl implements ClientAction
| {
| @In(create=true) private ClientService clientService;
| @In(required=false) @Out(required=false) ClientVO client;
| @In @Out(required=false) PolicyVO policy;
| @In(required=false) ClientVO subClient;
| @In(required=false) MasterSearchResultVO searchResult;
|
| @Begin(join=true)
| public String lookupClientFromSearch() {
| client=clientService.findClientByIdFetchGraph(searchResult.getClientVO().getId());
|
| if (client instanceof PersonVO)
| {
| organizationFlag=false;
| personFlag=true;
| System.out.println("The Client is a PersonVO");
|
| policy.getPolicyHolder();
| }
| else if (client instanceof OrganizationVO)
| {
| organizationFlag=true;
| personFlag=false;
| System.out.println("The Client is a PersonVO");
| }
| else
| {
| System.out.println("The Client is a only a ClientVO");
| }
|
| return "success";
| }
| @End
| ....
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056898#4056898
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056898
18Â years, 10Â months
[JBoss Seam] - Deployment of Seam-Gen apps to Glassfish
by rdg2cig
I am using Seam 1.2.0 PATCH 1 and am trying unsuccessfully to deploy an application created using Seam-Gen within the NetBeans plug-in to Glassfish V1. We use Glassfish/Sun AppServ and can not switch to JBoss (unfortunately). I can get the demo Glassfish application that is bundled with the Seam distribution to deploy but not the Seam-Gen created apps. I have tried both WAR and EAR project types without success. I would like to use the Hibernate JPA if possible since it appears to provide more features with a Seam-Gen application than Toplink Essentials.
I tried to use the same list of library JARs from the Glassfish demo but it does not seem to be complete for a Seam-Gen based app. Have looked at the stack traces when deployment fails and have added more JARs but still can't quite seem to find the right set and proper configuration. Could someone provide some guidance on the necessary JAR files to include for both types of Seam-Gen projects (WAR-based and EAR-base) and any additional configuration that is needed?
I think Seam-Gen can be the Java answer to ROR and I really, really want to get it working for me on Glassfish. I'm looking forward to any assistance the community can give me. Thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056896#4056896
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056896
18Â years, 10Â months