Re: ByteArray trimming - why?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Mar 06 2003 - 22:44:25 EST

  • Next message: Dirk Olmes: "Re: ByteArray trimming - why?"

    Haven't heard any objections, so I just checked in the fix for
    PostgreSQL SelectQueryTst, just like we discussed earlier. See
    'org.objectstyle.cayenne.access.trans.TrimmingQualifierTranslator" for
    details.

    Andrus

    Andrus Adamchik wrote:
    >
    > Trying to address all the issues discussed in this thread at once.
    >
    >
    > 1. Trimming vs. VAR[CHAR|BINARY].
    >
    > Yes, I agree with Holger and Dirk - using CHAR when you really need
    > VARCHAR is probably a bad design. But we must face it - there are
    > existing databases out there, and most people have no choice but to make
    > their apps work in this environment.
    >
    > So what is the suggested solution? Make it up to the users of course.
    > This may work like that - if your ObjAttribute is a String, we trim, if
    > it is char[]/CharacterArray - we don't. Same with binary types. This is
    > very easy to implement with ExtendedTypes, since they are keyed off of
    > the Java class.
    >
    >
    > 2. Trimming BINARY.
    >
    > I implemented it by analogy with CharType. I totally see how people
    > would store a byte[10] array in a BINARY(20) column. But then, this part
    > is really untested. All we need to do is add a few test cases and see if
    > the padding with zero byte really occurs.
    >
    > Andrus



    This archive was generated by hypermail 2.0.0 : Thu Mar 06 2003 - 22:46:08 EST