The plain-sql doc might need some updates. The snippet you just mentioned
here as an example is more insightful into what jooq supports then the
plain-sql page. Maybe we should have a supported tempting? prepared
statements ? section. On how to write
more complex queries in jooq using raw sql?
like the list() pattern would not be obvious to me without spending some
time on google + stack overflow. It's one of those snippets i'm saving for
later reference.
I also didn't see the {0}, {1} etc.. pattern mentioned in other places
besides this mailing list. I'm using it in code and it's good to know,
but I wouldn't know where to look that up if the doc.
Just my 2 cents.
--
Samir Faci
On Tue, Mar 21, 2017 at 9:11 AM, Lukas Eder <[email protected]> wrote:
> Hi Jerzy,
>
> Indeed, the Template interface was dropped, as we're not yet sure how to
> expose such an API to the public. However, the existing plain SQL API
> allows for quite a bit of templating out of the box:
> https://www.jooq.org/doc/latest/manual/sql-building/plain-sql
>
> Essentially, you can do things like:
>
> query("select {0} from {1} where {2}",
> list(
> field("a"),
> field("b")
>
> ), // corresponds to {0}
>
> table("t"), // corresponds to {1}
> condition("{0} = {1}",
> field("x"),
> val(1)
>
> ) // corresponds to {2}
>
> );
>
>
> Does this match your expectations? Or what particular MyBatis features are
> you looking for the most?
>
> Best Regards,
> Lukas
>
> 2017-03-21 16:05 GMT+01:00 <[email protected]>:
>
>> Hi all,
>>
>> I am looking into JOOQ as SQL templating engine.
>>
>> From what I see Template interface was dropped long time ago.
>> What should I look for to accomplish declarative SQL creation with
>> optional parts of where without doing it in Java code.
>>
>> I am basically looking for myBatis replacement.
>>
>> I will greatly appreciate any ideas
>>
>> Best regards
>>
>> Jerzy
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
Thank you
Samir Faci
https://keybase.io/csgeek
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.