-
1. Re: CMP2 relation : java.lang.ClassCastException
jboynes Nov 11, 2002 11:04 PM (in response to arnaudjamin)I'm guessing from the information you've supplied that User is the remote interface for your UserBean. If so it won't work as CMR requires you use the local interface.
-
2. Re: CMP2 relation : java.lang.ClassCastException
arnaudjamin Nov 12, 2002 6:15 AM (in response to arnaudjamin)Thanks, I'll look at the local interface.
What I don't understand is why the Jboss PDF documentation show this example :
public abstract class OrganizationBean implements EntityBean {
public abstract Set getMemberGangsters();
public abstract void setMemberGangsters(Set gangsters);
}
public abstract class GangsterBean implements EntityBean {
public abstract Organization getOrganization();
public abstract void setOrganization(Organization org
);
}
Should it be :
public abstract class OrganizationBean implements EntityBean {
public abstract Set getMemberGangsters();
public abstract void setMemberGangsters(Set gangsters);
}
public abstract class GangsterBean implements EntityBean {
public abstract OrganizationLocal getOrganization();
public abstract void setOrganization(OrganizationLocal org);
}
Thanks. -
3. Re: CMP2 relation : java.lang.ClassCastException
arnaudjamin Nov 12, 2002 9:36 AM (in response to arnaudjamin)Thanks for the answer.
It seems to work fine, but now i'm mixing the use of "localHome" and "RemoteHome".
So I just like to know why is the use of remoteHome since you can use LocalHome.
When should I use the remoteHome and when should i use the LocalHome?
(I hope my question is just not too stupid)
Thanks again. -
4. Re: CMP2 relation : java.lang.ClassCastException
jboynes Nov 12, 2002 12:10 PM (in response to arnaudjamin)The examples define Organization as a local interface - it's just xdoclet's convention to use X for remote and XLocal for local.
The spec restricts CMR to local interfaces to restrict CMP implementation to a single container - if it didn't the persistence manager would need to be interoperable between VMs (and vendors) which is probably unnecessary complexity.
I try and use local interfaces wherever I can - basically wherever I don't anticipate needing remote invocation. Check out the Session Facade pattern. Your mileage may vary - there's no one answer here. -
5. Re: CMP2 relation : java.lang.ClassCastException
arnaudjamin Nov 12, 2002 12:31 PM (in response to arnaudjamin)Thank you very much for your help.