db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Poeschl <mpoes...@marmot.at>
Subject Re: null foreign key not allow
Date Sat, 14 Dec 2002 14:12:01 GMT
Dan Tran wrote:

>Hi,
>
>I have table A which has  INTEGER column references (foreign key) a row ID of another
table B.  
>The reference is null allow.
>
>When I create A object with null value of the B object reference, a save to DB of object
A throws
>excexption, expecting Table B to have a row with ID 0.
>
>My configuration is MSSQL, Torque 3.0, MS driver.
>
>Is this a bug?
>
if you take a look at the java code you'll see the id is stored as int 
.. so it can't be null
if you need the column to be nullable set javaType="object" .. so it 
will be an Integer in the java code which can be null

martin

>
>Please advice.
>
>-Dan
>  
>



Mime
View raw message