db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vitzethum, Daniel" <Daniel.Vitzet...@gigatronik.com>
Subject Re: Torque tries to insert 0 into nullable Foreign Key
Date Mon, 06 Dec 2004 12:59:54 GMT
Hi Thomas,

thanks for the quick answer (as usual ;-)

> I had the same problem before, and as I needed a quick solution, I
> used string foreign keys instead (String foreign keys can be null). I
> will open a scarab issue on this problem.

my quick workaround:

I have overridden and copied "buildCriteria" of my table's peer and
inserted a condition, where necessary:

if (obj.getFkSomeCol() > 0) {
    criteria.add(FK_SOME_COL, obj.getFkSomeCol());

To be the above method being called, I had to override the method
"doInsert(MyObject obj, Connection con)", too, just copying the original



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

View raw message