You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Schmidt, Uwe" <US...@GEA-WIEGAND.DE> on 2001/11/09 08:24:14 UTC
torque fails using SMALLINT as primary key
Hi
I had a schema with a SMALLINT (short) as a primary key.
All works fine until I tried to select a record with doSelect();
I got all data except the primary key. Switching from SMALLINT
to INTEGER in the schema solved the problem.
the Schema:
<table name="PROGRAMS">
<column name="PRG_NDX" type="SMALLINT" required="true" primaryKey="true"
/>
<column name="START_SCREEN" type="VARCHAR" size="16" />
<unique>
<unique-column name="PRG_NDX"/>
</unique>
</table>
What I did in the code:
Criteria criteria = new Criteria();
Vector v = ProgramsPeer.doSelect(criteria);
Programs p = (Programs) v.elementAt(0);
Log.debug("start_screen=" + p.getStartScreen() + " prg_ndx=" +
p.getPrgNdx()); // no primary key ...
I am using TDK 2.1 / MySQL / WinNT
Uwe
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>