2013/10/8 Eric Schwarzenbach <[email protected]>

>
> I think the answer to my last question is that if my Fields (or other
> QueryParts) are created via DSL rather than a DSLContext********, they
> could be prone to problems if anything about their rendering depends on the
> context (like sql dialect). (Sorry it's been a long day! I should have
> inferred that earlier.) And I gather that even though these Fields are
> passed into methods that themselves are from a DSLContext, their
> contextless rendering has already been "fixed" and is not informed by the
> fact that they are being passed into a larger construction which does have
> context. (I wonder...is that problematic design feature?)
>

There are essentially two ways to render SQL in jOOQ 3.1:

- DSL.using(configuration).render(query);
- DSL.using(configuration).select(...).from(...).getSQL();

They're both pretty much the same, except that the first will use all
information (dialect, settings) form the configuration "external" to the
query, whereas the latter will attach the configuration to the query and
then use the information "internal" to the query to render the SQL. The
latter is mere convenience for the first.

There's an ongoing discussion about mutability of query objects, but let's
not merge this thread into that other discussion. I think that your current
design is fine.


> Perhaps this also relates to my question today in another thread about
> these Fields not knowing their type?
>
> That latter issue may lead me to change the way I get these Fields, to
> instead get them from the Table objects from the generated code. Would this
> be another way of avoiding such potential SQL rendering issues without
> having to render the parts separately and concatenate the SQL bits together?
>

I'm not sure how these things are related, and I'm getting confused. :-)
Maybe, you explain a bit more your concerns about using generated vs.
non-generated Fields in the other thread?

-- 
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/groups/opt_out.

Reply via email to