Re: SQLTemplate & HSQLDB question

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Jan 26 2006 - 18:37:39 EST

  • Next message: Steve Lorimer: "Re: SQLTemplate & HSQLDB question"

    > Would it work if in the select string everything was UPPERCASE?

    No. The essence of the problem is the capitalization mismatch between
    the schema you defined in CayenneModeler and the default
    capitalization used by the target database/driver. This is not
    something you can control by changing SQL syntax. I.e. if you run a
    query "SELECT spouse_first_name FROM ..." the column in the HSQL
    ResultSet will still be called "SPOUSE_FIRST_NAME".

    You can change capitalization of the DataMap (but then there is a
    chance that MySQL will have the opposite problem). For now the only
    solution that is DB-portable is #result() directive. In the future we
    may add extra scripting options.

    Andrus

    On Jan 26, 2006, at 3:17 PM, Daniel Lorimer wrote:
    > Steve,
    >
    > If the only issue is with capatalization, you should be able to
    > just convert the call to uppercase before you send the query - with
    > a method of some kind that runs when (if database = HSQL).
    >
    > Andrus,
    >
    > Would it work if in the select string everything was UPPERCASE?
    >
    >
    >
    > On 1/25/06, Andrus Adamchik <andru..bjectstyle.org> wrote:
    > On Jan 25, 2006, at 6:16 PM, Andrus Adamchik wrote:
    >
    > > You may have to do some typing here:
    > >
    > > SELECT #result('SPOUSE_FIRST_NAME' String 'spouse_first_name'),
    > > #result(...)
    >
    >
    > BTW, I'd love to improve SQLTemplate usability in this area. Maybe
    > introduce a callback variable that can be set in the template, like
    > #set( $toUpperCase = "true"), so Cayenne can read it and take an
    > appropriate action in the backend?
    >
    > Andrus
    >



    This archive was generated by hypermail 2.0.0 : Thu Jan 26 2006 - 18:37:42 EST