Hi Greg,
Thanks for your message. There's nothing wrong with your setup. This
should work for DDL and DML alike. There is one caveat I can think of,
though. How do you create your DML statements? If you're using plain SQL
templating API (
https://www.jooq.org/doc/latest/manual/sql-building/plain-sql-templating/),
then schema mapping does not apply, because we don't parse the templates.
You can recognise plain SQL templating API as it is annotated with
org.jooq.PlainSQL. In that case, you probably should use DSL.name() to
construct your identifiers instead.
Note, I would recommend using "^.*$" as a pattern to prevent generating
MY_SCHEMAMY_SCHEMA as can be shown here:
jshell> "abc".replaceAll(".*+", "xyz")
$1 ==> "xyzxyz"
jshell> "abc".replaceAll("^.*$", "xyz")
$2 ==> "xyz"
Thanks,
Lukas
On Wed, Oct 7, 2020 at 7:03 AM Greg Nielsen <[email protected]> wrote:
> Hello,
>
> Using jOOQ Professional, we are writing to a SQL Server instance. We're
> finding that only the DDL statements (eg create tables) seem to honor the
> MY-SCHEMA mapped schema, while the DML (eg inserts) is not.
>
> We're initializing our Settings object with:
>
>
> @Bean
> public Settings settings() {
> return new Settings()
> .withRenderCatalog(true)
> .withRenderSchema(true)
> .withRenderMapping(new RenderMapping()
> .withSchemata(new MappedSchema()
> .withInputExpression(Pattern.compile(".*+"))
> .withOutput("MY_SCHEMA")) );
> }
> I believe we're runing 3.13 - is there an additional setting we need to be
> configuring?
>
> Let me know what other info might be helpful.
>
> Thanks,
> Greg
>
> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/f1597c43-6dc6-41d8-afc5-a957d9cd4b76n%40googlegroups.com
> <https://groups.google.com/d/msgid/jooq-user/f1597c43-6dc6-41d8-afc5-a957d9cd4b76n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jooq-user/CAB4ELO4McMRiDkj28wLNgrpgv6OeUNu1gNnpZJtBYbpmotpdxA%40mail.gmail.com.