Re: Represesntation of database NULL as something else than Java null pointer

From: Tore Halset (halse..vv.ntnu.no)
Date: Thu Dec 14 2006 - 07:50:40 EST

  • Next message: Øyvind Harboe: "Re: Represesntation of database NULL as something else than Java null pointer"

    On Dec 14, 2006, at 9:11 , Øyvind Harboe wrote:

    > Could I implement my own "NeverNullString" datatype where I'm thinking
    > that .toString() returns the either what Cayenne java.lang.String
    > returns today or e.g. "" for the case where it represents a database
    > null?

    Or perhaps map java.lang.CharSequence and create a NullString that
    implements it. You could then create an ExtendedType (perhaps
    subclass CharType) that does what you want.

    If your cayenne version if from before the fix of CAY-540 you may
    have to register the type for each possible concreate class, just as
    I did in the JTS-example.

    You may get into some problems with the wrong (default) ExtendedType
    get picked before your own, but it should be fixable.

      - Tore.



    This archive was generated by hypermail 2.0.0 : Thu Dec 14 2006 - 07:51:29 EST