Have you set your schema to use defaultJavaType="object" ?

Do you use Integer objects or int? If you use int your FK will assume an integer value the default value being 0 (zero). Only if you use objects as opposed to primitive values will you be able to set any column to null.

As the DB can distinguish between null values and actual values you should always use defaultJavaType="object" in order to be able distinguish this in the application too.

Tarlika Elisabeth Schmitz

Saravana Kannan wrote:
AnswerGroup ansgrp = new AnswerGroup();
AnswerGroup ans = new Answer();
.
(calling setter methods)
.
ansgrp.save();
ansgrp.addAnswer(ans);
ans.save();

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.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to