db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl ...@apache.org>
Subject Re: set(Foreign key) throws exception for no reason?
Date Tue, 16 Mar 2010 18:04:05 GMT
Ludwig Magnusson wrote:
> Hi!
> When torque generates set methods for foreign keys, the methods thorws a
> TorqueException.
> Why is this? There is nothing in the methods that throws a TorqueException
> and removing the throws clause does not generate a compiler error.

Setting a foreign key could cause a consistency problem with the
database. If the record the foreign key points to does not exist, you
will get an exception on save() (depending on your schema). So this
Exception exists to allow you handling this problem beforehand. There is
no default action for this situation.

Bye, Thomas.

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

View raw message