You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Geoff Fortytwo <g4...@snowball.com> on 2001/10/23 00:09:00 UTC
[torque] multi-column primary key
How do I specify multi-column primary keys in a torque schema?
For instance, in the following schema the primary key should be made up of
"arenaClass" and "rank" together (arenaClass first).
<table name="ArenaClassRank" javaName="ArenaClassRank" idMethod="none"
skipSql="true">
<column name="arenaClass" javaName="ArenaClass" required="true"
type="INTEGER" size="3"/>
<column name="rank" required="true" type="INTEGER" size="3"/>
<column name="name" required="true" type="VARCHAR" size="40"/>
</table>
Would it be sufficient to add primaryKey="true" in both those fields or is
there another way that it should be done?
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: [torque] multi-column primary key
Posted by Daniel Rall <dl...@finemaltcoding.com>.
Geoff Fortytwo <g4...@snowball.com> writes:
> How do I specify multi-column primary keys in a torque schema?
>
> For instance, in the following schema the primary key should be made
> up of "arenaClass" and "rank" together (arenaClass first).
>
> <table name="ArenaClassRank" javaName="ArenaClassRank"
> idMethod="none" skipSql="true">
> <column name="arenaClass" javaName="ArenaClass" required="true"
> type="INTEGER" size="3"/>
> <column name="rank" required="true" type="INTEGER" size="3"/>
> <column name="name" required="true" type="VARCHAR" size="40"/>
> </table>
>
> Would it be sufficient to add primaryKey="true" in both those fields
> or is there another way that it should be done?
That's exactly what you want.
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: [torque] multi-column primary key
Posted by John McNally <jm...@collab.net>.
Geoff Fortytwo wrote:
>
> How do I specify multi-column primary keys in a torque schema?
>
> For instance, in the following schema the primary key should be made up of
> "arenaClass" and "rank" together (arenaClass first).
>
> <table name="ArenaClassRank" javaName="ArenaClassRank" idMethod="none"
> skipSql="true">
> <column name="arenaClass" javaName="ArenaClass" required="true"
> type="INTEGER" size="3"/>
> <column name="rank" required="true" type="INTEGER" size="3"/>
> <column name="name" required="true" type="VARCHAR" size="40"/>
> </table>
>
> Would it be sufficient to add primaryKey="true" in both those fields or is
That is sufficient.
john mcnally
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org