It should work fine as it does for me. What JBoss version are you using? Do you have a testcase?
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Hanson, Matthew > Sent: Tuesday, December 23, 2003 5:00 PM > To: '[EMAIL PROTECTED]' > Subject: [JBoss-user] 1:1 Unidirectional (Aggregate) > Relationship Problem > > Hi-- > > We are storing the key from a reference table in another > table. We would like to create a unidirectional, 1:1 > relationship to allow the first bean to access information in > the reference table. Here is basically how the table > relationship is setup: > > tableA > id (integer primary key) > ref_id (integer) > > tableB > id (integer primary key) > some data > some data > . > . > . > > I was assuming that I could create the relationship such that > the bean container could be configured to get information > from tableB based on the value in the ref_id column of > tableA. However, the relationship seems to be drawing info > from tableB based upon the value in the primary key tableA.id > instead. How do I change this? > > The following is the relationship configuration in ejb-jar.xml: > > <relationships > > <ejb-relation > > <ejb-relation-name>Grain-GrainReference</ejb-relation-name> > > <ejb-relationship-role > > > <ejb-relationship-role-name>Grain-Has-Reference</ejb-relations > hip-role-name> > <multiplicity>One</multiplicity> > <relationship-role-source > > <ejb-name>RecipeGrainBean</ejb-name> > </relationship-role-source> > <cmr-field > > <cmr-field-name>refRecipeGrain</cmr-field-name> > </cmr-field> > </ejb-relationship-role> > > <ejb-relationship-role > > > <ejb-relationship-role-name>Reference-Of-Grain</ejb-relationsh > ip-role-name> > <multiplicity>One</multiplicity> > <relationship-role-source > > <ejb-name>RefRecipeGrainBean</ejb-name> > </relationship-role-source> > </ejb-relationship-role> > > </ejb-relation> > . > . > . > > The following is the configuration from jbosscmp-jdbc.xml: > > <relationships> > <ejb-relation> > <ejb-relation-name>Grain-GrainReference</ejb-relation-name> > > <ejb-relationship-role> > > <ejb-relationship-role-name>Grain-Has-Reference</ejb-relations > hip-role-name> > <key-fields> > <key-field> > <field-name>recipeGrainId</field-name> > <column-name>recipe_grain_id</column-name> > </key-field> > </key-fields> > > </ejb-relationship-role> > <ejb-relationship-role> > > <ejb-relationship-role-name>Reference-Of-Grain</ejb-relationsh > ip-role-name> > <key-fields/> > > </ejb-relationship-role> > </ejb-relation> > . > . > . > > I am using the xdoclet ejb.relation and jboss.target-relation > to facilitate the relationship. If anyone on the off chance > would know the attributes that help specify this type of > relationship, that would be amazing... > Otherwise, knowing how the deployment files should look would > even help, a lot! > > Please help! > > Regards, > Matt Hanson > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign > up for IBM's Free Linux Tutorials. Learn everything from the > bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user