/** * Create an instance of {@link Database } * */ public Database createDatabase() { return new Database(); }
public static void codegen() throws Exception { List<ForcedType> forcedTypes = JooqConfig.defaultForcedTypes(); HikariDataSource ds = CMSConnectionPools.processing(); Configuration configuration = new Configuration() .withJdbc(new Jdbc() .withDriver(Driver.class.getName()) .withUrl(ds.getJdbcUrl()) .withUser(ds.getUsername()) .withPassword(ds.getPassword())) .withGenerator(new Generator() .withDatabase(new Database() .withName(MySQLDatabase.class.getName()) .withIncludes(".*") .withExcludes("") .withIncludeExcludeColumns(true) .withForcedTypes(forcedTypes) .withInputSchema("sj_cms")) .withGenerate(new Generate() .withJavaTimeTypes(true)) .withStrategy(new Strategy() .withName(CustomGeneratorStrategy.class.getName())) .withTarget(new Target() .withPackageName("com.stubbornjava.cms.server.generated") .withDirectory("src/generated/java"))); GenerationTool.generate(configuration); }
org.jooq.meta.jaxb.Database d = defaultIfNull(g.getDatabase(), new org.jooq.meta.jaxb.Database()); String databaseName = trim(d.getName()); Class<? extends Database> databaseClass = !isBlank(databaseName) g.setDatabase(new org.jooq.meta.jaxb.Database()); if (!StringUtils.isBlank(g.getDatabase().getSchemaVersionProvider())) generator.setUseSchemaVersionProvider(true);