/** * Create an instance of {@link Configuration } * */ public Configuration createConfiguration() { return new Configuration(); }
generator.getTarget().setDirectory(new File(project.getBasedir(), generator.getTarget().getDirectory()).getCanonicalPath()); Configuration configuration = new Configuration(); configuration.setLogging(logging); configuration.setJdbc(jdbc);
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); }