You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Emmanuel Dupont <em...@jwaretechnologies.com> on 2003/07/10 09:53:35 UTC

RE : Using null value with FK

It works well Vincent !


-----Message d'origine-----
De : Charles Anthony [mailto:charles.anthony@hpdsoftware.com] 
Envoyé : jeudi 10 juillet 2003 08:36
À : 'OJB Users List'
Objet : RE: Using null value with FK

Hi Vincent,

If the attribute that the column represents is an "int" i.e. the java
primitive, OJB cannot directly assign it a value of null.

The simplest solution for this is to not use primitives as attributes if
they can be null.

If you really want/need to keep the attribute as a primitive, you will have
to use a FieldConversion..... see
http://db.apache.org/ojb/jdbc-types.html for more information. 

Cheers,

Charles.

>-----Original Message-----
>From: Vincent Frison [mailto:turman@ohmforce.com]
>Sent: 09 July 2003 22:30
>To: OJB Users List
>Subject: Using null value with FK
>
>
>Hi,
>
>I've read somewhere in this ML that, since the latest 
>releases, OJB uses
>null values for FK when the referenced object is null. But it doesn't,
>it uses the default 0 value instead (the FK is a int). Note that my FK
>field descriptor is defined with the nullable attribute.
>
>This is really annoying since it isn't compatible with the FK 
>constraint
>of my DB (PostgreSQL). So I guess I've misunderstood a basic concept..
>
>Vincent
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-user-help@db.apache.org
>


This email and any attachments are strictly confidential and are intended
solely for the addressee. If you are not the intended recipient you must
not disclose, forward, copy or take any action in reliance on this message
or its attachments. If you have received this email in error please notify
the sender as soon as possible and delete it from your computer systems.
Any views or opinions presented are solely those of the author and do not
necessarily reflect those of HPD Software Limited or its affiliates.

 At present the integrity of email across the internet cannot be guaranteed
and messages sent via this medium are potentially at risk.  All liability
is excluded to the extent permitted by law for any claims arising as a re-
sult of the use of this medium to transmit information by or to 
HPD Software Limited or its affiliates.



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


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