Hi,

I'm confused...  I cannot remove the target-relation tag, because it is
needed to generate the jbosscmp-jdbc.xml mappings for the relationshipp I'm
trying to create.

What I am trying to do is fetch data from tableB based on a key found in
tableA, in a 1:1 relationship, where tableB is reference data and has no
knowledge of tableA and used as a lookup so that tableA doesn't need to
store a bunch of duplicate data for each entry.

Here is an example of something I want to do:

1) Beer Recipe table
Recipe_Grain_Id - primary key
Grain_Type - integer mapping to the grain table mapping to grain.grain_id

2) Grain table
Grain_Id - primary key
Grain_name - data
Grain data 1
Grain data 2
Etc.

How should this relationship be set up?

I initially thought of making it a 1:1 unidirectional, where the recipe
table can return the local bean object of the grain itself.  However, I
don't seem to be able to get the jbosscmp-jdbc.xml relationship element
setup for jboss to understand this.

Is this just something that cannot be done in this context?  If it can be
done, how would the relationship look in jbosscmp-jdbc.xml (key-field,
column-name, field-name)?  Does this have anything to do with primary key
fields?  The code in JDBCRelationshipRoleMetaData.java, where the exceptions
have been thrown, seems to look like the grain_type column from table #1
must be a primary key field.

I'm lost...  Can someone set me straight on if this relationship should
work???  I would really need to know exactly how the relationship should
look in jbosscmp-jdbc.xml.

Thanks, in advance, for the help...

Regards,
Matt Hanson

-----Original Message-----
From: Alexey Loubyansky [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 1:27 PM
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] 1:1 Unidirectional (Aggregate) Relationship
Problem


Because you mapped the foreign key to the primary key field with this:
    *   @jboss.target-relation fk-column="recipe_grain_id"
    *           related-pk-field="recipeGrainId" 

Just removed it.




-------------------------------------------------------
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

Reply via email to