Hi,
I am getting a ClassCastException while creating a new row in a
table. I have posted a question regarding same in the user list. In
order to solve it quickly I am trying to look in the torque code and
have some questions. It would be great if someone can help me understand
this.
In BasePeer's doInsert method -
public static ObjectKey doInsert(Criteria criteria, Connection con)
throws TorqueException
We retrieve primary key using the following line
ColumnMap pk = getPrimaryKey(criteria);
Is this the right way to do it? What if a table has a composite
key?
Moreover doInsert returns the value of primary key after inserting and
it always returns a single value. Is that correct? I think this is the
reason for me getting a ClassCastException in table's Peer's
setPrimaryKey() method. BasePeer returns a single key but setPrimaryKey
is expecting an array.
I am not very knowledgeable in the Torque code, so can anyone
advice if I am doing something wrong or how can I fix this.
Regards,
Amit.
My table definition.
<table name="SC_COMMON_ORDERS">
<column name="id" required="true" primaryKey="true"
autoIncrement="true" type="INTEGER"/>
<column name="line_number" required="true" primaryKey="true"
default="1" type="INTEGER"/>
---other columns
</table>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]