On Fri, 7 Dec 2001, David Budworth wrote:

> FYI, in case you didn't know (this killed me at first when trying to do
> my generator):
> 
>       <field-name>iD</field-name> <!-- this is the PK field of the other object -->
>       <column-name>APPLICATION_ID</column-name> <!-- this is the FK column in this 
>table -->
> 

oh shit... ok... thanks a heap... didn't know that (o:

so, what happens in the case of a complex pk in the other ejb?

<!--
The foreign-key-field element declared the configuration of a foreign
key. The field-name element must match the field-name of one of the
primary key fields of the related element. This is similar to the
REFERANCES clause of a SQL foreign key declaration.
-->
<!ELEMENT foreign-key-field (field-name,
         ((column-name, (jdbc-type, sql-type)?) | (property*))
         )>

ok, if I had've read that I should've known that... time to spend a bit
more time in the dtd methinks.... but...

alright... similar to a SQL foreign key declaration... if the other type
has a complex fk, then we need multiple fk fields really...  which of
course we can have... hmmm....  ok... this is making sense to me now.... 

(continued...)

> > >         <ejb-relation>
> > >             <ejb-relation-name>Application-Asset</ejb-relation-name>
> > >             <foreign-key-mapping>
> > >                 <ejb-relationship-role>
> > >                     
><ejb-relationship-role-name>Application-has-Asset</ejb-relationship-role-name>
> > >                     <foreign-key-fields />
> > >                 </ejb-relationship-role>
> > >                 <ejb-relationship-role>
> > >                     
><ejb-relationship-role-name>Asset-belongsto-Application</ejb-relationship-role-name>
> > >                     <foreign-key-fields>
> > >                         <foreign-key-field>
> > >                             <field-name>iD</field-name>
> > >                             <column-name>APPLICATION_ID</column-name>
> > >                         </foreign-key-field>
> > >                     </foreign-key-fields>
> > >                 </ejb-relationship-role>
> > >             </foreign-key-mapping>
> > >         </ejb-relation>    

so, the reason the first ejb-relationship-role has an empty
foreign-key-fields element is because of course it doesn't have a fk
column in the table... so...  my logic should be:

for each relation
  does this side of the relation need a fk ?
    no :
      create role name tag and empty fk fields tag
    yes :
      does the other side have a complex pk ?
        no :
          create a role name and fk field for the pk field
        yes :
          for each pk field, create a role name and fk field

that about right?

cheers
dim


_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to