Re: Passing null values in parameters, part 2 )

From: Evgeny Ryabitskiy (evgeny.ryabitski..mail.com)
Date: Tue Sep 29 2009 - 05:43:12 EDT

  • Next message: Andrus Adamchik: "Re: Passing null values in parameters, part 2 )"

    > i.e. from the user standpoint, extra #bind(..) wrapper seems redundant. Now wonder if we can extend that to other directives,
    > such as #result?

    Not sure that #bind(..) directive is redundant. It can seems redundant
    like it was from my first user standpoint, but now I understand how
    Velocity is working :)

    Practically for me is not hart to tell every "SQL-Query-Writer" to use
    #bind($Param) where he expects some parameters.
    But it is huge work if we should set JDBC types.... it's much easy to
    do some hints about type from Java Code, sometimes real expected type
    is known only at runtime.

    That is my Idea. I should think a little about #result directive.

    I create CAY-1280 and attached draft patch. Maybe I should export this
    mail conversion there?

    > I like the idea, but maybe we can take this even further, and provide an API substitute for the entire directive, e.g. instead of
    >
    > #bind($bindDirective)
    >
    > we'd have
    >
    > $bindDirective

    I think bind is necessary course we can use parameters not only for Binding.

    Like passing table name to template:
        1) SELECT * FROM $MyParamTable

    And we should separate such queries from binding:
        2)  SELECT * FROM Table1 where PersonName = #bind($MyParamName)

    We can't use just PersonName = $MyParamName course string in SQL
    should be in ' '
    Another one very useful thing is that while we use bind we are sending
    precompiled queries which is very cool.

    So I don't think we could do it without bind... in theory we can do
    intelligent analyze of SQL query and parameter to determine if we
    should do bind or put it in template (like table name) but it's not
    cool! or we can rewrite common rendering of simple template variable
    in Velocity... which is also not cool (IMHO).

    Maybe I have missed something.... what is your idea?

     Best regards,
     Evgeny Ryabitskiy.



    This archive was generated by hypermail 2.0.0 : Tue Sep 29 2009 - 05:43:30 EDT