Dain Sundstrom wrote:

>>OK i'm playing with the latest RH CVS and testing out 1 to many 
>>relations (bi directional). So ..
>>
>>Table1 {
>>  primary_key int,
>>}
>>
>>TableMany {
>>  primary_key int,
>>  table1_key  int,
>>}
>>
>>class Table1 {
>>   int getPrimary_key()
>>   Collection getTableMany();
>>}
>>
>>class TableMany {
>>   int getPrimary_key();
>>   int getTable1_key();
>>}
>>
>>the problem is that when it tries to fetch TableMany it looks for a 
>>field  called table1_key_primary_key. It would seem that the 
>>default key 
>>should not be made up but the foreign key of the other side of the 
>>relationship. So line 80 of JDBCRelationshipRoleMetaData.java should 
>>just be
>>tempCmrFieldName = relatedRole.getEntityName();
>>
>>
> 
> 1. Defaults can be overridden.
>

This is the default case. The strange cases should be overridden. Read 
Marc's bit about packaging.

 
> 2. What happens when you have two one-to-many relationships between Table1
> and TableMany?
> 

Doesn't matter you still need Table1's primary key in TableMany. So you 
would have

Table1 {
   Collection getTableMany();
   Collectiont getTableMany2();
}

TableMany {
int getTable1_key();
int getTable2_2_key();
}

        





_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to