It seems that torques has a problem with the auto-generated code for
foreign-keys if the key is negative. Looking at the generated code the
reason seems obvious. Is there any reason why the check of "this.stageId
> 0" exists? Removing it seems to cause no ill effect in my code except
that it will now work correctly with negative (non-zero keys).
Any ideas,
David Zverina.
-----------------------------------------------
public Stage getStage() throws TorqueException
{
if (aStage == null && (this.stageId > 0))
{
aStage =
StagePeer.retrieveByPK(SimpleKey.keyFor(this.stageId));
/* The following can be used instead of the line above to
guarantee the related object contains a reference
to this object, but this level of coupling
may be undesirable in many circumstances.
As it can lead to a db query with many results that may
never be used.
Stage obj = StagePeer.retrieveByPK(this.stageId);
obj.addItems(this);
*/
}
return aStage;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]