Hello Kim,

Based on my understanding of your situation, I would advise the approach of
using the simplest possible DAO methods and keeping the query complexity
within your application code. For instance, if a GET endpoint takes name,
age, id, etc as query parameters, your resource method could fire off
simple `SELECT * FROM table_name WHERE foo = bar` depending on whatever
condition(s) you want.

This is simply because I find application code to be easier to test and
maintain, in contrast to SQL code inlined as strings in annotations.

On Fri, Oct 14, 2016 at 1:15 PM, Kim Kantola <kkant...@gmail.com> wrote:

> Hi All,
>
> I am new to JDBI.  I have seen several simple examples of annotating a DAO
> with a query like "Select * from tableName where id=?".
>
> Could someone point me to documentation for more complex queries such as
> searching by a dynamic list of parameters?  For example, a user can search
> by name, age, id, height, etc, but I am unaware until runtime which
> combination of these search parameters may come in to my search method.  I
> may not get a search value for age, and so do not need to bind anything to
> the search query for that.
>
> Any pointers appreciated,
> ~Kim
>
> --
> You received this message because you are subscribed to the Google Groups
> "dropwizard-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dropwizard-user+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Evan Meagher

-- 
You received this message because you are subscribed to the Google Groups 
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dropwizard-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to