db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "netseeker" <netsee...@manskes.de>
Subject RE: please help with complexObjectModel
Date Wed, 18 Feb 2004 10:56:53 GMT
Hi Eugene,

I guess your column is named exactly as the related table, eg. foreign
column name ="SomeTable" and related table name="SomeTable". With complex
object model torque tries to generate two methods: one to retrieve the
column value and
another one to retrieve the related table object(s). Just rename your
column, eg. column name="test_id" and you will
get the following two methods: "getTestId()" for the value and "getTest()"
for the related object.
Foreign keys should be never named exacly as the related table.

Wrong:
    <table name="SomeTable">
        <column name="AnotherTable" size="8" type="DECIMAL"/>
	  ...
        <foreign-key foreignTable="AnotherTable">
            <reference foreign="AnotherTable" local="AnotherTable"/>
        </foreign-key>
    </table>

    <table name="AnotherTable">
        <column name="AnotherTable" primaryKey="true" required="true"
            size="8" type="DECIMAL"/>
        ...
    </table>

Right:
    <table name="SomeTable">
        <column name="AnotherTableId" size="8" type="DECIMAL"/>
	  ...
        <foreign-key foreignTable="AnotherTable">
            <reference foreign="AnotherTableId" local="AnotherTableId"/>
        </foreign-key>
    </table>

    <table name="AnotherTable">
        <column name="AnotherTableId" primaryKey="true" required="true"
            size="8" type="DECIMAL"/>
        ...
    </table>


so long
Michael

> -----Original Message-----
> From: E.Nebrat [mailto:e.nebrat@tacisenergy.org.ua]
> Sent: Wednesday, February 18, 2004 11:40 AM
> To: torque-user@db.apache.org
> Subject: please help with complexObjectModel
>
>
> Hi,
> could you help me and explain why it happens?
> I use torque-gen-3.1 from binaries.
> There is a table for SomeObject in the schema-definition, which has
> foreign key on the one column. When I set complexObjectModel to true (as
> I would like to), generator produces corresponding  BaseSomeObject.java
> with as much as two (not one?)  methods for getting this column value:
> int getSomeValue()
> and
> SomeValueType getSomeValue()
> consequently, I cannot compile this. How could I manage this?
> Thank you very much for help, and excuse for obviously stupid question.
>
> --
> BR, Eugene Nebrat.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.591 / Virus Database: 374 - Release Date: 17.02.2004
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.591 / Virus Database: 374 - Release Date: 17.02.2004


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


Mime
View raw message