Could someone explain what is happening here as I am not 100% sure of the exact mechanism in operation. I have the thing working OK but I had to configure things differently to how I was expecting. And no, I'm not using xdoclet as I want to understand what is going on!
I have two simple Entity Beans that represent these tables:
And there is a many to one relationship from movies to director.
- The Movie Bean has a remote interface which the client talks to. - The Director bean has only a local interface.
I have a Movie remote Home business method:
I have setup a CMR in the configuration files and all works fine.
Here is my ejb-jar.xml file:
You can see the EJB-QL for the method:
The jbosscmp-jdbc.xml file is below:
The comment I have put in the above file explains my problem. It does not make too much sense that I have to define the foriegn-key mapping on the DirectorBean side of the relationship. As there are only two sides to the relationship, I guess Jboss can work it out but I don't understand the reasoning behind it.