-
1. Re: How to model CMR 1:2 (not 1:1 or 1:many)?
jcordes Sep 3, 2002 10:04 AM (in response to psabadin)Hi Paul!
Hmm.. So basically you have two 1:1 uni-directional relationships with S and T for L ...
I assume that the code-snippet is taken from the actual source. Based on the assumption I can say that there are at least three typos in there. It should look like this:
public abstract class L implements EntityBean
{
...
// WANT CMR getters and setters like this...
public abstract NodeLocal getSourceNode();
public abstract void setSourceNode(NodeLocal sourceNode);
// and
public abstract NodeLocal getTargetNode();
public abstract void setTargetNode(NodeLocal targetNode);
}
Hope it helps,
Jochen. -
2. Re: How to model CMR 1:2 (not 1:1 or 1:many)?
psabadin Sep 3, 2002 1:14 PM (in response to psabadin)Thanks Jochen,
Problem remains. The actual source code is as you state (setter args are correct). My source was in error as posted.
The problem is THE NAMING of the properties! If I have only ONE uni-directional relationship AND NAME IT BASED ON THE BEAN TYPE <getNode() setNode(NodeLocal InNode)> it works! if I NAME the property <getSourceNode(), setSourceNode(NodeLocal InSrcNode)> it barfs on deploy with the error message as in the first post.
??? Must ALL relationship getters/setters ONLY be named with the BeanType. That is, do I have to say getBeanType()/setBeanType(BeanTypeLocal InMyBean) and NOT ...
public abstract BeanTypeLocal getMyName();
public abstract void setMyName(BeanTypeLocal InMyBean); // ???
If so, then I can't name my propert ANYTHING BUT the name of the BeanType! Which suggests that this sucks! -
3. Re: How to model CMR 1:2 (not 1:1 or 1:many)?
dsundstrom Sep 3, 2002 7:30 PM (in response to psabadin)> ??? Must ALL relationship getters/setters ONLY be
> named with the BeanType. That is, do I have to say
> getBeanType()/setBeanType(BeanTypeLocal InMyBean) and
> NOT ...
No. Did you declare both relationships? If you look at the commerce test in the JBoss Testsuite an Order has a ShippingAddress and a BillingAddress, which are both Address EJBs. -
4. Re: How to model CMR 1:2 (not 1:1 or 1:many)?
psabadin Sep 3, 2002 7:49 PM (in response to psabadin)I will chck this out and report back. It is very important for my application.
Thank you for the quick response, Dain. -
5. Re: How to model CMR 1:2 (not 1:1 or 1:many)?
psabadin Sep 4, 2002 2:30 PM (in response to psabadin)Close this one out. My bad.
A better understanding of ejb-jar.xml and jbosscmp-jdbc.xml set right my misunderstandings.
Dain's CMP docs certainly help with this!
Thanks all - bye
Paul