/** * Create an instance of {@link Jdbc } * */ public Jdbc createJdbc() { return new Jdbc(); }
public Jdbc withProperties(Property... values) { if (values!= null) { for (Property value: values) { getProperties().add(value); } } return this; }
public Jdbc withDriver(String value) { setDriver(value); return this; }
j = defaultIfNull(j, new Jdbc()); if (j.getDriver() == null) j.setDriver(System.getProperty("jooq.codegen.jdbc.driver")); if (j.getUrl() == null) j.setUrl(url); if (j.getUser() == null) j.setUser(System.getProperty("jooq.codegen.jdbc.user")); if (j.getUsername() == null) j.setUsername(System.getProperty("jooq.codegen.jdbc.username")); if (j.getPassword() == null) j.setPassword(System.getProperty("jooq.codegen.jdbc.password")); Properties properties = properties(j.getProperties()); if (!properties.containsKey("user")) properties.put("user", defaultString(defaultString(j.getUser(), j.getUsername()))); if (!properties.containsKey("password")) properties.put("password", defaultString(j.getPassword())); connection = driver.newInstance().connect(defaultString(j.getUrl()), properties); j = defaultIfNull(j, new Jdbc()); if (!StringUtils.isBlank(j.getSchema())) log.warn("WARNING: The configuration property jdbc.Schema is deprecated and will be removed in the future. Use /configuration/generator/database/inputSchema instead"); schema.setInputSchema(trim(j.getSchema()));
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); }
public Jdbc withUser(String value) { setUser(value); return this; }
public Jdbc withUsername(String value) { setUsername(value); return this; }
public Jdbc withPassword(String value) { setPassword(value); return this; }
public Jdbc withUrl(String value) { setUrl(value); return this; }
if (!jdbc.equals(other.jdbc)) { return false;
public Jdbc withProperties(Collection<Property> values) { if (values!= null) { getProperties().addAll(values); } return this; }