Re: Converting non-string and non-numeric expression parameters to EJBQL

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Jun 11 2008 - 03:37:12 EDT

  • Next message: Andrey Razumovsky (JIRA): "[jira] Commented: (CAY-894) CM Usability: Welcome Screen (Panel)"

    On Jun 11, 2008, at 3:26 AM, Lachlan Deck wrote:

    > Would that then be like this:
    > EJBQLQuery query; // assume exists
    > for (Map.Entry<String,Object> param : parametersCallback) {
    > query.setParameter(param.getKey(), param.getValue());
    > }
    >
    > Or would there still need to be special treatment given to dates and
    > the like?

    Yes - as simple as your example above. Nothing special to do about
    dates, etc.

    >> Note that this does not affect how you create your original
    >> Expression objects.
    >>
    >> Does that sound reasonable?
    >
    > Sounds good, sure (so far as mapping between cayenne expressions and
    > EJBQL). I wonder, however, if the parameters callback would be more
    > generally useful. i.e., if it would make sense to place all values
    > in there and not just the ones that can't be stringified.

    Possibly, especially for non-integer numerics, to avoid any possible
    fuzziness.

    > Would it also make sense to have a Cayenne based CountQuery?
    > e.g.,
    > CountQuery count = new CountQuery(SelectQuery);

    We've had extensive discussions abut "utility" queries in the past. I
    think we do need query-related utility classes/methods in some form. I
    am not sure there should be a standalone query for each one of them.
    Consider that there are also AVG, MAX, MIN, and other things that a
    user might want to select. But more generally making those types of
    queries easier to assemble and run is on the TODO list.

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Jun 11 2008 - 03:37:52 EDT