db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saravana Kannan <skka...@engr.uky.edu>
Subject Creating records with value NULL for FKs
Date Mon, 03 May 2004 00:21:00 GMT

Related in the sense, the assumption in your question is the reason for my 
question. Looks like you got ticked off by my mail for some reason - if so, 
sorry about that.

Can someone help me?

I will post me question again just in case -

I have a Torque Object called Answer which is related to AnswerGroup and 
ExprNode. Answer can be either the child of AnswerGroup OR a child of ExprNode 
(ie Answer has two FKs - one referencing AnswerGroup and the other referencing 

So I do something like-

AnswerGroup ansgrp = new AnswerGroup();
AnswerGroup ans = new Answer();
(calling setter methods)

And I get the Torque Exception which is the result of an Oracle constraint 
error. The Oracle error was something of the sort-
"Foreign key 0 does not exist in ExprNode"

The question here is - Why is Torque/Village setting ANSWER.ExprNodeFK to "0" 
when I never called ExprNode.addAnswer(ans) or ans.setExprNodeFK() ? I want the 
ANSWER.ExprNodeFK to be null. I'm unable to create foreign keys which are null. 
How does one create a FK which is null? As is the norm, my foreign keys are of 
type INTEGER in the project-schema.xml.

Ofcourse I could create a dummy ExprNode by hand that has PK = 0 and not use it 
anywhere. But I want to find the better or proper way to take care of this 
problem. Using ExprNode with PK=0 will be my last resort.

If the problem I mention is the way Torque works, then I would like to suggest a 
solution to this problem as a feature of newer releases of Torque. Thank you.


There are 10 kinds of people in the world,
those who know binary and those who don't.

Quoting T E Schmitz <mailreg@numerixtechnology.de>:

> I'm sorry but I can't see how the problem you describe is related to my 
> question. My Question was whether outer joins are supported or not and 
> if not, what the work-around could be.
> Regards,
> Tarlika Elisabeth Schmitz

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

View raw message