Dynamic sql - complex selects

33 views
Skip to first unread message

John O'Hanley

unread,
Sep 24, 2013, 1:32:14 PM9/24/13
to web4j...@googlegroups.com
How about some overloads in the Db class, that take a simple String instead of SqlId?

Would this apply to selects only?

- John

John O'Hanley

unread,
Sep 24, 2013, 1:35:46 PM9/24/13
to web4j...@googlegroups.com
Something like the Db.search method.

search(Class<T> aClass, String aDynamicSql, Object... aParams)

Thomas Hallgren

unread,
Sep 24, 2013, 1:38:29 PM9/24/13
to web4j...@googlegroups.com
Please note that I already have an implementation of this that has been in production for some time. I would love to discuss it further, but as I explained in an other thread, I'm not much in favor of conducting such a discussion over a mail forum.

- thomas


On 2013-09-24 15:35, John O'Hanley wrote:
Something like the Db.search method.

search(Class<T> aClass, String aDynamicSql, Object... aParams)

--
You received this message because you are subscribed to the Google Groups "web4j-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web4j-users...@googlegroups.com.
To post to this group, send email to web4j...@googlegroups.com.
Visit this group at http://groups.google.com/group/web4j-users.
For more options, visit https://groups.google.com/groups/opt_out.

John O'Hanley

unread,
Sep 24, 2013, 1:47:54 PM9/24/13
to web4j...@googlegroups.com
Fair enough. Thanks for the idea. I will likely add it to the next version, with a credit to Thomas Hallgren.

- John.

John O'Hanley

unread,
Sep 27, 2013, 6:54:13 PM9/27/13
to web4j...@googlegroups.com
FYI

After taking a closer look, it looks like this is do-able with the existing API.

The crux of the matter is that although the DynamicCriteria class focuses on WHERE and ORDER BY, I think it's actually more general than that. It doesn't enforce a strict separation between static and dynamic pieces.

That is, as far as my tests have shown me, you can use a blank static part, and build the whole sql in code; that is, DynamicCriteria is misnamed/misleading, and should be called DynamicSql.

I will work on cleaning up the documentation, and some related implementation details.

- John.
Reply all
Reply to author
Forward
0 new messages