[JBoss Seam] - Re: Can I end a conversation programmatically?
by raffaele.camanzo
Hi Gavin,
probably I did not explain correctly what I asked to you then I try to explain what I found strange in the Seam behaviour replying to your post but with a little description of the starting scenario:
At the moment 0 I have two tabs opened: one with a search function to search for A stuff and one with a search function to search for B stuff, they share the same *outcome* but, obviously, not the same conversation.
At the moment 1 the user search for his A stuff finds what he needs and clicks on the link which opens a new tab with both different conversation and different outcome.
At the moment 2 the user selects the search stuff A tab (which gets the focus) and closes it because he found what he needs.
Now I find the problem:
I get the conversation id and the outcome of the tab immediately after the one the user wants to close in order to resume the conversation and switch to the correct view id after having removed the current conversation, in my scenario I get the data of the search stuff B tab (same outcome of the search stuff A but different conversation)
- If I execute only
| Conversation.instance().end();
|
and return the outcome of the tab which reaches the focus (the search stuff B) Seam ends the conversation of search stuff A tab but freezes the screen (maybe because gets back the same outcome and then does nothing)
- If I execute
| Conversation.instance().end();
| Manager.instance().switchConversation(newTabConvId);
|
and return the outcome of the tab which reaches the focus Seam switches correctly to the search stuff B tab but when I try to ask again for the search stuff A from the menu (I want to search for some other A stuff) the tab contains the data of the conversation I thought to be removed.
I made a test case really less complicated than my application and what I see can be resumed as follows:
- If I call only the Conversation.instance().end() Seam ends the conversation but I cannot switch to what I need for
- If I call both the methods Seam switches to what I need for but does not end the conversation
One last thing:
[cite]
I also don't understand why you think that calling end() should result in a call to some @End method.
[/cite]
This means that I cannot expect that calling the end of a conversation programmatically can cause the execution of the @End method of the conversation I'm ending?
Hope you can help me.
Regards,
Raffaele Camanzo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025476#4025476
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025476
19Â years, 1Â month
[JBoss Seam] - Two components with the same name and precedence
by NielsH
When using the seam libraries as compiled from the latest version of CVS I get the following exception when deploying my application. Reverting back to a version of March 2 makes the problem go away. It does not depend on my project; generating a new trivial project with seam-gen gives the same issue.
BTW. I am using JBoss-4.0.5.
| java.lang.IllegalStateException: Two components with the same name and precedence: org.jboss.seam.ui.resource.dynamicImageResource
| at org.jboss.seam.init.Initialization.addComponentDescriptor(Initialization.java:400)
| at org.jboss.seam.init.Initialization.installScannedComponentAndRoles(Initialization.java:553)
| at org.jboss.seam.init.Initialization.installScannedClass(Initialization.java:499)
| at org.jboss.seam.init.Initialization.scanForComponents(Initialization.java:493)
| at org.jboss.seam.init.Initialization.init(Initialization.java:475)
| at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
| at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
| at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
| at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
| at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
| at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
| at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
| at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
| at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
| at org.jboss.web.WebModule.startModule(WebModule.java:83)
| at org.jboss.web.WebModule.startService(WebModule.java:61)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy49.start(Unknown Source)
| at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
| at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
| at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy50.start(Unknown Source)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy8.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.start(Unknown Source)
| at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy5.deploy(Unknown Source)
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| at org.jboss.Main.boot(Main.java:200)
| at org.jboss.Main$1.run(Main.java:490)
| at java.lang.Thread.run(Thread.java:619)
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025473#4025473
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025473
19Â years, 1Â month
[JBoss Seam] - Re: How to use ice:dataTable and @DataModel?
by danoakland
I wouldn't say that it's without problems, but I did get the sortable table working with Seam 1.1.5 (and now upgraded to 1.1.6). I haven't gone to 1.2 yet.
The trick that I had to use is to provide the ice:dataTable with the actual DataModel itself, not the outjected variable from Seam. For example, I have a bean that manages a table of companies that can be sorted by name or main office location:
| @Stateful
| @Name("companyList")
| @Scope(ScopeType.SESSION)
| public class CompanyListBean extends CompanyList {
| ...
|
| @DataModel
| private List<CompanyListObject> companies;
|
| ...
|
| public boolean isAscending() {
| // getter
| }
|
| public void setAscending(boolean ascending) {
| // setter
| }
|
| public String getSortColumn() {
| // getter
| }
|
| public void setSortColumn(String columnName) {
| // setter
| }
|
| ...
|
| public javax.faces.model.DataModel getResults() {
| if (companies.size() > 1) {
| // do sort logic if necessary...
| java.util.Collections.sort(companies, someComparator);
| }
| return (javax.faces.model.DataModel) Contexts
| .getSessionContext().get("companies");
| }
|
Then in the Faces view you use ice:dataTable like this:
| <ice:dataTable value="#{companyList.results}" var="result"
| sortColumn="#{companyList.sortColumn}"
| sortAscending="#{companyList.ascending}" ... >
| <ice:column>
| <f:facet name="header">
| <ice:commandSortHeader columnName="name" arrow="true">
| <ice:outputText value="Company Name" />
| </ice:commandSortHeader>
| </f:facet>
| <h:outputLink value="#{result.url}">
| #{result.name}
| </h:outputLink>
| </ice:column>
| <ice:column>
| <f:facet name="header">
| <ice:commandSortHeader columnName="city" arrow="true">
| <ice:outputText value="Main Office" />
| </ice:commandSortHeader>
| </f:facet>
| <h:outputText>
| #{result.city}
| </h:outputText>
| </ice:column>
| </ice:dataTable>
|
and it works for me. I may have omitted some stuff from my example there, but hopefully you get the gist of it...
It seems that Seam doesn't outject the updated DataModel on a partial submit, but the "getResults" method will.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025472#4025472
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025472
19Â years, 1Â month
[JBoss Seam] - DataModel, Factory and Stale Data
by smutchler
Is it possible to use a SSB with a DataModel. It's funny that the examples in the books and the JBoss web site use a SFSB and then say it's not a good idea to use SFSB with Seam. The problem I have with SSB is that the data is often stale. If you modify it in another SB (or even the same SB) and then return to the page it is showing the stale data. There has to be a way to do this without using SFSB or resorting to using a conversation. I can do this with straight JSF easily.
Your help is GREATLY appreciated!
Here is my SFSB:
@Stateful
@Scope(ScopeType.SESSION)
@Name("inventoryAction")
public class InventoryActionImpl implements Serializable, InventoryAction {
Logger log = Logger.getLogger(InventoryActionImpl.class);
@DataModel
private List inventory;
@DataModelSelection
@Out(required = false)
private Car car;
@PersistenceContext(type = PersistenceContextType.EXTENDED)
private EntityManager em;
@Factory(value = "inventory")
public void fetchInventory() {
CarDAO carDAO = new JPACarDAO(em);
inventory = carDAO.filterByStatus(Car.STATUS_AVAILABLE);
}
public String buy() {
return "buy_car_admin";
}
public String edit() {
return "edit_car_info";
}
public String createNew() {
car = new Car();
return "add_car";
}
public String deleteInventory() {
List toBeDeleted = new ArrayList();
for (Car car : inventory) {
if (car.isSelected()) {
toBeDeleted.add(car);
}
}
// delete from database
CarDAO carDAO = new JPACarDAO(em);
carDAO.delete(toBeDeleted);
// refresh cached inventory (seems to work)
// but I'm screwed if another SB updates the data
fetchInventory();
return null;
}
@Remove
@Destroy
public void destroy() {
}
}
Thanks,
Scott
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025468#4025468
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025468
19Â years, 1Â month
[JBoss Seam] - seam-gen and mutiple foreign keys
by NielsH
I have generated a project with seam-gen based on generate-entities. All works fine, except for the generation of the home interfaces. In one of my tables I have two foreign keys to the same table. In the home interface two references are created to the appropriate object, but with the same name (which of course doesn't compile).
Here is a simplified example:
Table 1
| CREATE TABLE test
| (
| id int4 NOT NULL DEFAULT nextval('test_id_seq'::regclass),
| name varchar,
| id_test2_1 int4,
| id_test2_2 int4,
| CONSTRAINT test_pkey PRIMARY KEY (id),
| CONSTRAINT test_id_test2_1_fkey FOREIGN KEY (id_test2_1)
| REFERENCES test2 (id) MATCH SIMPLE
| ON UPDATE NO ACTION ON DELETE NO ACTION,
| CONSTRAINT test_id_test2_2_fkey FOREIGN KEY (id_test2_2)
| REFERENCES test2 (id) MATCH SIMPLE
| ON UPDATE NO ACTION ON DELETE NO ACTION
| )
|
Table2
| CREATE TABLE test2
| (
| id int4 NOT NULL DEFAULT nextval('test2_id_seq'::regclass),
| name varchar,
| CONSTRAINT test2_pkey PRIMARY KEY (id)
| )
|
First Entity
| @Entity
| @Table(name = "test", schema = "public")
| public class Test implements java.io.Serializable {
|
| private int id;
| private Test2 test2ByIdTest22;
| private Test2 test2ByIdTest21;
| private String name;
|
| public Test() {
| }
|
| public Test(int id) {
| this.id = id;
| }
| public Test(int id, Test2 test2ByIdTest22, Test2 test2ByIdTest21,
| String name) {
| this.id = id;
| this.test2ByIdTest22 = test2ByIdTest22;
| this.test2ByIdTest21 = test2ByIdTest21;
| this.name = name;
| }
|
| @Id
| @Column(name = "id", unique = true, nullable = false)
| @NotNull
| public int getId() {
| return this.id;
| }
|
| public void setId(int id) {
| this.id = id;
| }
| @ManyToOne(fetch = FetchType.LAZY)
| @JoinColumn(name = "id_test2_2")
| public Test2 getTest2ByIdTest22() {
| return this.test2ByIdTest22;
| }
|
| public void setTest2ByIdTest22(Test2 test2ByIdTest22) {
| this.test2ByIdTest22 = test2ByIdTest22;
| }
| @ManyToOne(fetch = FetchType.LAZY)
| @JoinColumn(name = "id_test2_1")
| public Test2 getTest2ByIdTest21() {
| return this.test2ByIdTest21;
| }
|
| public void setTest2ByIdTest21(Test2 test2ByIdTest21) {
| this.test2ByIdTest21 = test2ByIdTest21;
| }
|
| @Column(name = "name", length = 0)
| @Length(max = 0)
| public String getName() {
| return this.name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
|
| }
|
second entity
| @Entity
| @Table(name = "test2", schema = "public")
| public class Test2 implements java.io.Serializable {
|
| private int id;
| private String name;
| private Set<Test> testsForIdTest21 = new HashSet<Test>(0);
| private Set<Test> testsForIdTest22 = new HashSet<Test>(0);
|
| public Test2() {
| }
|
| public Test2(int id) {
| this.id = id;
| }
| public Test2(int id, String name, Set<Test> testsForIdTest21,
| Set<Test> testsForIdTest22) {
| this.id = id;
| this.name = name;
| this.testsForIdTest21 = testsForIdTest21;
| this.testsForIdTest22 = testsForIdTest22;
| }
|
| @Id
| @Column(name = "id", unique = true, nullable = false)
| @NotNull
| public int getId() {
| return this.id;
| }
|
| public void setId(int id) {
| this.id = id;
| }
|
| @Column(name = "name", length = 0)
| @Length(max = 0)
| public String getName() {
| return this.name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "test2ByIdTest21")
| public Set<Test> getTestsForIdTest21() {
| return this.testsForIdTest21;
| }
|
| public void setTestsForIdTest21(Set<Test> testsForIdTest21) {
| this.testsForIdTest21 = testsForIdTest21;
| }
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "test2ByIdTest22")
| public Set<Test> getTestsForIdTest22() {
| return this.testsForIdTest22;
| }
|
| public void setTestsForIdTest22(Set<Test> testsForIdTest22) {
| this.testsForIdTest22 = testsForIdTest22;
| }
|
| }
|
Home interface of first entity. Here we have two Test2Home references, both with the name test2Home.
| @Name("testHome")
| public class TestHome extends EntityHome<Test> {
|
| @In(create = true)
| Test2Home test2Home;
| @In(create = true)
| Test2Home test2Home;
|
| public void setTestId(Integer id) {
| setId(id);
| }
|
| public Integer getTestId() {
| return (Integer) getId();
| }
|
| @Override
| protected Test createInstance() {
| Test test = new Test();
| return test;
| }
|
| public void wire() {
| Test2 test2ByIdTest22 = test2Home.getDefinedInstance();
| if (test2ByIdTest22 != null) {
| getInstance().setTest2ByIdTest22(test2ByIdTest22);
| }
| Test2 test2ByIdTest21 = test2Home.getDefinedInstance();
| if (test2ByIdTest21 != null) {
| getInstance().setTest2ByIdTest21(test2ByIdTest21);
| }
| }
|
| public boolean isWired() {
| return true;
| }
|
| public Test getDefinedInstance() {
| return isIdDefined() ? getInstance() : null;
| }
|
| }
|
BTW. I used the latest seam version from CVS.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025467#4025467
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025467
19Â years, 1Â month