-
1. Re: Relationships over different jar's
juha May 26, 2004 11:09 AM (in response to jdwn)Last time I tried this it was not possible. I don't know if 3.2.x has changed wrt this.
-
3. Re: Relationships over different jar's
jdwn May 26, 2004 11:45 AM (in response to jdwn)First of all, thanks for the quick replies!
I watched the other topic (already watched it in a previous search), but it's surprising me that it's impossible to have relationships over different jar's.
This means that I've to put nearly all my entity beans in one jar file (or dd). This is impossible and makes EB nearly unusable for me.
If I think of it more, it's saying that in a DB, two tables can't have a relationship even when they are in the same DB!
Are there possible workarounds for this huge problem?
Thnx!
Joris -
4. Re: Relationships over different jar's
jae77 May 26, 2004 12:26 PM (in response to jdwn)i believe this can be done (i'm pretty sure i'm doing it right now).
are you including the deployment descriptor information for the related beans? (you may also need to set dependencies on the other ejbs to make sure they are deployed before you app). -
5. Re: Relationships over different jar's
ironbird May 26, 2004 12:35 PM (in response to jdwn)"jdwn" wrote:
I watched the other topic (already watched it in a previous search), but it's surprising me that it's impossible to have relationships over different jar's.
You watch badly ! -
6. Re: Relationships over different jar's
jdwn May 27, 2004 3:37 AM (in response to jdwn)Thanks a lot! One week of searching, never giving up, even when other people are saying it's impossible. It's possible!!!
Just put the entity you're refering to also in the ejb-jar.xml file and in the jbosscmp-jdbc.xml file.
Thnx!
Joris -
7. Re: Relationships over different jar's
jdwn May 27, 2004 8:35 AM (in response to jdwn)And the story never ends :-)
After I got the relationship between two different jar files working, I ran very quickly in the following problem:
Entity A is in jar 1
Entity B1 is in jar 2
Entity B2 is in jar 2
Now A is having a relationship with B1. This is working perfect by calling A.getB1() and A.setB1().
But B1 is having a relationship with B2. When I try to call in a session bean in jar 1 A.getB1().getB2() I get the following error:
Method is not a known CMP field accessor, CMR field accessor, or ejbSelect method: methodName=XXXXXXXX
If I call B1.getB2() inside jar 2 there's no problem.
So I think I'll have to put the DD of B2 also in the DD of jar 1. But I'll also have to put the DD of the relationship between B1 and B2 in the DD of jar 1.
The problem is I don't know how to put these relationship tags in the DD using XDoclet.
Adding extra tags is easy by defining an other xml file, but I can't find anything about adding extra <ejb-relation> tags
Any help is welcome
Thanks a lot!!
Joris -
8. Re: Relationships over different jar's
zarni Jul 9, 2004 5:44 PM (in response to jdwn)Hey!
"jdwn" wrote:
And the story never ends :-)
So I think I'll have to put the DD of B2 also in the DD of jar 1. But I'll also have to put the DD of the relationship between B1 and B2 in the DD of jar 1.
The problem is I don't know how to put these relationship tags in the DD using XDoclet.
Adding extra <entity> tags is easy by defining an other xml file, but I can't find anything about adding extra <ejb-relation> tags
Joris
To add some extra rel. to the ejb-jar use the ejbdoclet task and run
this within the task.
Put a file named "relationships.xml" in the ${merge.dir}, and make sure the
extra relationships you need are in there :-) .
You may want to look here also :
http://xdoclet.sourceforge.net/xdoclet/ant/xdoclet/modules/ejb/dd/EjbDotXmlSubTask.html
Have a nice day! -
9. Re: Relationships over different jar's
zarni Jul 9, 2004 5:47 PM (in response to jdwn):-) He he ... this part disapeard ... :-)
<!--deploymentdescriptor
destdir="${generated-src.dir}"
validatexml="true"
mergeDir="${merge.dir}"
description="somedescription"
>
--> -
10. Re: Relationships over different jar's
crevette Aug 17, 2004 6:10 AM (in response to jdwn)Just put the entity you're refering to also in the ejb-jar.xml file and in the jbosscmp-jdbc.xml file
i try this but have a InstanceAlreadyExists exception.
so i try to put the realtions in the relationships.xml file, but the relations are not take into account.
some idea?
thanks