/** * Create an instance of {@link Configuration } * */ public Configuration createConfiguration() { return new Configuration(); }
public Configuration withGenerator(Generator value) { setGenerator(value); return this; }
public Configuration withJdbc(Jdbc value) { setJdbc(value); return this; }
in = new FileInputStream(file); Configuration configuration = GenerationTool.load(in); generator = configuration.getGenerator(); jdbc = configuration.getJdbc(); generator.getTarget().setDirectory(new File(project.getBasedir(), generator.getTarget().getDirectory()).getCanonicalPath()); Configuration configuration = new Configuration(); configuration.setLogging(logging); configuration.setJdbc(jdbc); configuration.setGenerator(generator);
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); }
if (configuration.getLogging() != null) { switch (configuration.getLogging()) { case TRACE: JooqLogger.globalThreshold(Level.TRACE); log.debug("Input configuration", "" + configuration); Jdbc j = configuration.getJdbc(); org.jooq.meta.jaxb.Generator g = configuration.getGenerator(); if (g == null) throw new GeneratorException("The <generator/> tag is mandatory. For details, see " + Constants.NS_CODEGEN);
public Configuration withLogging(Logging value) { setLogging(value); return this; }