Re: sql template and column types...

From: Robert Zeigler (robert..uregumption.com)
Date: Sat Aug 04 2007 - 17:00:52 EDT

  • Next message: james: "Re: Temporal Database (Almost)"

    Hm... maybe it's time to try out the milestone. :)

    Robert

    On Aug 4, 2007, at 8/43:44 PM , Andrus Adamchik wrote:

    > Yes, #result directive is rather limited. I posted my thoughts on
    > how to improve it here:
    >
    > https://issues.apache.org/cayenne/browse/CAY-813
    >
    > In the meantime in 3.0 I've added an unofficial JDBC type parameter
    > #5 to the #result directive used by Cayenne internally (in addition
    > to another unofficial parameter #4 which is a column label).
    > "Unofficial" means that although it works now, we'll throw these
    > two parameters away once a better alternative is implemented
    > without any backwards compatibility support.
    >
    > Andrus
    >
    >
    >
    > On Aug 4, 2007, at 11:32 PM, Robert Zeigler wrote:
    >> Hm... I noticed that SQLTemplate doesn't even set the jdbc type of
    >> it's column descriptors... (at least, not in 2.x cayenne...)
    >> Should it? There's probably not enough information in #result to
    >> guess the type, but maybe a little later in the process,
    >> those value could be initialized from the query metadata? Just
    >> wondering, since it throws a kink into extended type conversion.
    >> (For example, the Enum type conversion fails when using
    >> sqltemplate and numeric-based columns because the type
    >> is Types.NULL (0), and so it tries do to an Enum.valueOf("string")
    >> call, which will fail since the "string" is a number...
    >>
    >> Certainly, the individual types can be adjusted to examine the
    >> result set metadata, rather than the type argument passed to it.
    >> But that seems like the wrong place to fix this. Thoughts?
    >>
    >> Robert
    >>
    >



    This archive was generated by hypermail 2.0.0 : Sat Aug 04 2007 - 17:01:22 EDT