Jooq code generation “excludes” not working with typesafe config

19 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Lap Ming Lee

ungelesen,
09.10.2015, 01:30:5909.10.15
an jOOQ User Group

I am trying to exclude two tables created by Liquibase when using TypeSafe Config. 

jooq {
    # databasechangelog = Liquibase generated tables
    # databasechangeloglock = Liquibase generated tables
    excludes = "databasechangelog, databasechangeloglock"
  }

When I only supply one excludes such as "databsechangelog", it works. 

More than one excludes should be separated by a comma (http://www.jooq.org/doc/2.6/manual/code-generation/codegen-configuration/), but instead it generated both tables. 

Doing this is not allowed either. 

excludes = "databasechangelog", "databasechangeloglock"

Inside the library, its simplifying calling this (note: getExcludes is a  String )

    database.setExcludes(new String[]{StringUtils.defaultString(d1.getExcludes())});

Has anyone else ran into this problem?  This doesn't really seem right since array initialization would require comma separated strings

Lap Ming Lee

ungelesen,
09.10.2015, 01:49:2609.10.15
an jOOQ User Group

Here's my code generation fyi

      new GenerationTool {
        setConnection(connection)
        run(new Configuration {
          withGenerator(new Generator {
            withName(config.jooq.generatorClass)
            withDatabase(new org.jooq.util.jaxb.Database {
              withIncludes(config.jooq.includes)
              withExcludes(config.jooq.excludes)
              withInputSchema(config.jooq.inputSchema)
              withName(config.jooq.databaseClass)
            })
            withTarget(new Target {
              withPackageName(config.jooq.pkg)
              withDirectory(config.jooq.directory)
            })
            withGenerate(new Generate {
              setDaos(true)
            })
          })
        })
      }

Lukas Eder

ungelesen,
09.10.2015, 03:52:3809.10.15
an jooq...@googlegroups.com
Hello,

You're referencing the manual from version 2.6. In the old days, we used comma-separated lists of expressions in includes/excludes - but believe it or not, some people had commas in their table/column names, which is why we dumped the commas. After all, includes / excludes are just regular expressions, and you can separate your individual patterns using the "union operator", the pipe: |

I.e. write:

jooq {
    # databasechangelog = Liquibase generated tables
    # databasechangeloglock = Liquibase generated tables
    excludes = "databasechangelog|databasechangeloglock"
}
This is also documented here in the section "feature removals" (look for "comma-separated"):

Hope this helps,
Lukas

--
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 jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lukas Eder

ungelesen,
09.10.2015, 05:14:5509.10.15
an jOOQ User Group
For the record, this question has also been asked on Stack Overflow:

There is no need for a name

ungelesen,
09.10.2015, 05:52:1309.10.15
an jOOQ User Group
Thank you for the quick reply :) 

Regards, 
- Lap 
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten