-
1. Re: Returning custom class from session bean method
chewitty Mar 13, 2002 6:04 AM (in response to erik777)I am not sure I understand you correctly but if my guess is correct, you are trying to pass your custom class as a parameter to a remote interface method; and then after your remote call you are expecting to have access to the same data that would have been populated on the server.
Eventhough, your custom class may be Serializable (assuming that it is), the component on the server and that on the client are two distinct entities. It is not possible to achieve what you appear to be looking for this way - it is simply wrong.
If you want to insist on doing it this way, then try making your custom object itself a remote object ...
Cheers,
Ferdinand -
2. Re: Returning custom class from session bean method
erik777 Mar 14, 2002 12:08 AM (in response to erik777)Here is the specific problem. I am returning a Collection of DomainBeans that is the result of a query. This works. However, since there is a possibility the query should include a "virtual global" domain, one for which you cannot instantiate an object, and therefore cannot include in the collection, I created another class that simply has two items, the collection, and a boolean indicating whether or not the "virtual global" domain should be included in the result set.
Now I want to pass back this class, instead of the Collection. Because the class is a simply work around, it seems like overkill to try to take it further by defining it as an EJB and creating interfaces for it.
In reality, our methods can pass back all kinds of classes, such as the String class, or other simple classes. Why should this be any different?
I did verify that I am somehow able to do this with another simple class. So, why might it not work this time.