db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brycenesbitt <bry...@obviously.com>
Subject foreign-key generation maps NumberKey to int, and code fails to compile
Date Tue, 14 Aug 2007 06:59:06 GMT

I'm adding a table to an older Torque based application:

    <table name="CCS_MEMBER">
        <column default="0" name="MEMBER_ID" primaryKey="true"
            required="true" type="INTEGER"/>
        <column default=""  name="FIRST_NAME" size="127" type="VARCHAR"/>
        <column default=""  name="LAST_NAME" size="127" type="VARCHAR"/>
        <foreign-key foreignTable="CCS_COUPON">
            <reference local="MEMBER_ID" foreign="MEMBER_ID"/>

   <table name="CCS_COUPON">
        <column name="COUPON_ID" type="INTEGER" primaryKey="true"
required="true" autoIncrement="true" />
        <column name="MEMBER_ID"       type="INTEGER" required="true" />
        <column name="EXPIRES"         type="DATE"/>

But when Torque generates the classes there is a type mismatch.  The coupon
gets an integer for MEMBER_ID, but the member generates a NumberKey.  Is
there a way to resolve this?  It seems OK if the primary key maps to another
primary key (both are NumberKeys).

Is there a way to force Torque to use a NumberKey for a non-primary key?
Or to force Torque to use an integer for a primary key (more risky, since
that's a change to existing code)?

If it matters, this is Torque 3.0-b4 (yes, beta 4).

View this message in context: http://www.nabble.com/foreign-key-generation-maps-NumberKey-to-int%2C-and-code-fails-to-compile-tf4265600.html#a12139688
Sent from the Apache DB - Torque Users mailing list archive at Nabble.com.

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

View raw message