2015-04-08 12:41 GMT+02:00 Mark Derricutt <[email protected]>:
> On 8 Apr 2015, at 22:20, Lukas Eder wrote:
>
> > Yes, they're double quoted inside the string literal unless you tell
> jOOQ via RenderNameStyle.AS\_IS not to quote identifiers / names. But that
> seems to be correct?
>
> Very strange - that actually seems to be working now from a standalone
> test, and getting the correct escaping. I can't even reproduce what I
> mentioned in the original email, but I wonder, if I actually wrote the
> wrong thing. I noticed an earlier revision of my code I had:
>
> Sequence<Integer> seq = DSL.sequenceByName(Integer.class,
> "schema.some_id_seq");
>
Hmm, yes, that would be wrong usage of "sequenceByName()". The idea is
really that each String argument of the varargs parameter is a "segment" /
"path" of the fully qualified name. Putting "schema.some_id_seq" really
just means that the name is literally "schema.some_id_seq" as in:
CREATE SEQUENCE "schema.some_id_seq"
> Which is similar to how I've defined tables via
> DSL.tableByName("schema.some_table"): without separating out the schema -
> the tables work, the schema however doesn't:
>
> select nextval('"schema.some_id_seq"')
>
Hmm, the tables work? Are you sure? They would work after using
RenderNameStyle.AS_IS.
Or perhaps you used DSL.table("schema.some_table"), which produces "plain
SQL" AST elements, not names / identifiers
> I'll update my code to separate the schema portion - but should one work
> and not the other?
You can always get things to work by tweaking things, e.g. by using
RenderNameStyle.AS_IS.
But the semantic difference between the DSL.xxxByName() and DSL.xxx() is
well defined, although it can be a bit confusing at first...
--
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.