Re: Validation: null vs. empty string

From: Mike Kienenberger (mkienen..laska.net)
Date: Thu Apr 01 2004 - 16:05:30 EST

  • Next message: jir..bjectstyle.org: "[OS-JIRA] Created: (CAY-114) Null vs. Empty String validation"

    Andrus Adamchik <andru..bjectstyle.org> wrote:
    > As it stands now, Cayenne validation exception is thrown when a string
    > property is either NULL or an empty string. Empty string case is rather
    > questionable as was pointed out to me by Eric Schneider. I was going to
    > remove this particular "validation" and just keep the null check.
    >
    > So I figured I'd do some more testing. It turned out that all tested
    > databases indeed distinguish between NULL an "", except for Oracle
    > (surprise !!) So I wonder what's the best way to implement a solution.
    > First thing that comes to mind is to make validator customizable per
    > DbAdapter. Any other ideas?

    Well, for the optimistic locking "is null" vs ["= ?" bind null], I was
    thinking that an adaptor boolean (canBindNullInUpdateQualifier) of the
    behavior itself would be best. What with everything else Oracle breaks,
    I'd say an adaptor boolean is the way to go
    (canDistinquishBetweenNullAndEmptyString).

    I don't quite understand the issue above, but I'm sure it affects me.

    -Mike



    This archive was generated by hypermail 2.0.0 : Thu Apr 01 2004 - 16:04:53 EST