Hi Lukas Sure it helps, thanks a lot =)
++ joseph On Friday, June 10, 2016 at 8:27:26 AM UTC+2, Lukas Eder wrote: > > Hi Joseph, > > Thank you very much for your enquiry. I quickly checked and noticed that > RenderMapping is currently not applied for table(Name) calls, so the > rendermapping approach won't work for you here. This is a bug. I've > registered an issue for this: > https://github.com/jOOQ/jOOQ/issues/5344 > > But you don't need mapping in your case. Notice how the > createTable[IfNotExists]() method is overloaded and also accepts a Name or > a Table argument. You can construct org.jooq.Name references using > DSL.name(): > > http://www.jooq.org/javadoc/latest/org/jooq/impl/DSL.html#name-java.lang.String...- > > They model qualified names. E.g. DSL.name("SCHEMA_NAME", "TABLE_NAME"). > You can pass that directly to the CREATE TABLE statement, or wrap it > explicitly in a table via DSL.table(Name), e.g. table(name("SCHEMA_NAME", > "TABLE_NAME")). > > Hope this helps. > Lukas > > 2016-06-09 23:59 GMT+03:00 <[email protected] <javascript:>>: > >> Hi >> >> I tried various ways to define a schema when creating table but I don't >> manage to get it work. >> >> For example, when writing : >> val dsl: DSLContext = using(dataSource, dialect, new >> Settings().withRenderMapping(new >> RenderMapping().withDefaultSchema("SCHEMA_NAME"))) >> dsl.createTableIfNotExists("FOO").columns(...).execute() >> >> But after in the logs I see: create table if not exists "FOO" (..) => the >> schema is missing >> >> When I try to query it through the table template approach (cf // >> https://stackoverflow.com/questions/35154523/jooq-table-template-dynamic-table-name-for-queries), >> >> it then fails because the template rightly prefix the table name by the >> schema... >> >> What am I missing ? >> >> Thanks in advance >> >> Best, >> joseph >> >> -- >> 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] <javascript:>. >> 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.
