Hi,
If I may add a note:
It's certainly good to avoid primitives for FK fields, but the unnecessary
SELECT statements with WHERE FK=null are
currently generated also when using non-primitives such as Integer. It
would be nice if this could be avoided.
Regards,
Gerhard
[EMAIL PROTECTED]
15.10.2003 13:24
Bitte antworten an "OJB Users List"
An: [EMAIL PROTECTED]
Kopie:
Thema: RE: How to map optional 1:1 relationship
Hello,
> -----Original Message-----
> From: Boyes, Carl [mailto:[EMAIL PROTECTED]
> I've currently
> mapped it as a 1:1, but the when the foreign key reference is
> null an extra sql statement with a where condition of
> fkey = ''
> is generated.
this question has been asked fairly often
(for example by myself). See e.g. thread
"Null references and proxies".
The solution is to use java reference types
as foreign key fields (unlike in the OJB
examples / junit tests), Integer instead of int.
I can really highly recommend that.
Olli
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]