db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frederico Augusto Costa" <facosta_lis...@terra.com.br>
Subject Inserting NULL for foreign refereces
Date Sat, 16 Aug 2003 20:24:31 GMT
Hi folks!

    I have a silly question and I was not able to find a similar case on
list archive.
I have a table A with the following columns:
A_ID                      INTEGER PRIMARY NOT NULL
A_NAME              VARCHAR(X) NOT NULL
B_ID                      INTEGER NULL (Is a foreign reference for B_ID from
table B)

I also have a table B:
B_ID                      INTEGER PRIMARY NOT NULL
B_NAME              VARCHAR(X) NOT NULL

When I try to insert values on table A as following, I get a referential
integrity violation:
A a = new A()
a.setAName("XXXX");
a.save();

I think Torque is trying to insert 0 on B_ID (default values from new
integer types are 0) but
I really want to set it NULL.
Any clues?


Frederico Augusto Costa
------
        "What time is it?"
        "I don't know, it keeps changing."




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


Mime
View raw message