You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by David Fry <DF...@yipes.com> on 2003/06/03 23:20:44 UTC

RE: Xdoclet support !

Hi Tom,

Since I'm not a Torque expert either, I'll give you my best guess...

Here is the code from the last email for reference:

Java Source:
    
    /**
     *  @ojb.field
     */
    private Integer generalAddressId;
    /**
     *  @ojb.reference   class-ref="com.blah.businessObjects.CompanyAddress"
     *                  foreignkey="generalAddressId"
     *
     */
    protected CompanyAddress generalAddress;
    /**
     *  @ojb.field
     */
    private Integer billingAddressId;
    /**
     *  @ojb.reference   class-ref="com.blah.businessObjects.CompanyAddress"
     *                  foreignkey="billingAddressId"
     *
     */
    protected CompanyAddress billingAddress;

<ojbrepository> correctly generates seperate reference-descriptor tags:

    <reference-descriptor
        name="generalAddress"
        class-ref="com.blah.businessObjects.CompanyAddress"
    >
        <foreignkey field-ref="generalAddressId"/>
    </reference-descriptor>
    <reference-descriptor
        name="billingAddress"
        class-ref="com.blah.businessObjects.CompanyAddress"
    >
        <foreignkey field-ref="billingAddressId"/>
    </reference-descriptor>

But <torqueschema> incorrectly generates one foreign-key tag:

	  <foreign-key foreignTable="COMPANY_ADDRESS">
            <reference local="generalAddressId"
foreign="COMPANY_ADDRESS_ID"/>
            <reference local="billingAddressId"
foreign="COMPANY_ADDRESS_ID"/>
        </foreign-key>

I think that the schema file should contain:

	<foreign-key foreignTable="COMPANY_ADDRESS">
            <reference local="generalAddressId"
		foreign="COMPANY_ADDRESS_ID"/>        
	</foreign-key>

	<foreign-key foreignTable="COMPANY_ADDRESS">
      	<reference local="billingAddressId"
		foreign="COMPANY_ADDRESS_ID"/>
        </foreign-key>

Thanks
David


-----Original Message-----
From: Thomas Dudziak [mailto:tomdz@first.gmd.de]
Sent: Friday, May 23, 2003 2:13 PM
To: ojb-user@db.apache.org
Subject: RE: Xdoclet support !


Hi David,

since I'm not really a torque expert, please tell me how it should look
like instead. The torque documentation
(http://db.apache.org/torque/schema-reference.html) is not that helpful in
this respect.

Thanks,
Tom



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org