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 Re: Inserting NULL for foreign refereces
Date Thu, 21 Aug 2003 20:08:47 GMT
Eric,
     Thanks, it is working fine now!
[]'s
Frederico Augusto Costa
------
    Sometimes the best medicine is to stop taking something.

----- Original Message -----
From: "Eric Emminger" <eric@ericemminger.com>
To: "Apache Torque Users List" <torque-user@db.apache.org>
Sent: Monday, August 18, 2003 3:54 PM
Subject: Re: Inserting NULL for foreign refereces


> Frederico
>
> >     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?
>
> In your schema xml, are you using javaType="object" for the primary- and
> foreign-key columns?
>
> Eric
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
>
>



---------------------------------------------------------------------
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