Java 类org.jooq.impl.DefaultDataType 实例源码

项目:stratio-jdbc-sink-mariadb    文件:TemplateQueryGenerator.java   
public TemplateQueryGenerator(final SQLDialect sqlDialect, final String sql) {
    final Matcher m = PARAMETER_PATTERN.matcher(sql);

    parameters = new ArrayList<Parameter>();

    while (m.find()) {
        final String part = m.group("part").toUpperCase(Locale.ENGLISH);
        final String header = m.group("header");
        final String type = m.group("type").toUpperCase(Locale.ENGLISH);
        DataType<?> dataType = DefaultDataType.getDataType(sqlDialect, type);
        if (BODY.equals(part)) {
            if (header != null) {
                throw new IllegalArgumentException("BODY parameter must have no header name specifier (${body:" + type + "}, not  (${body." + header + ":" + type + "}");
            }
        }
        final Parameter parameter = new Parameter(header, dataType);
        parameters.add(parameter);
        log.trace("Parameter: {}", parameter);
    }

    this.sql = m.replaceAll("?");
    log.debug("Generated SQL: {}", this.sql);
}
项目:ingestion    文件:TemplateQueryGenerator.java   
public TemplateQueryGenerator(final SQLDialect sqlDialect, final String sql) {
    final Matcher m = PARAMETER_PATTERN.matcher(sql);

    parameters = new ArrayList<Parameter>();

    while (m.find()) {
        final String part = m.group("part").toUpperCase(Locale.ENGLISH);
        final String header = m.group("header");
        final String type = m.group("type").toUpperCase(Locale.ENGLISH);
        DataType<?> dataType = DefaultDataType.getDataType(sqlDialect, type);
        if (BODY.equals(part)) {
            if (header != null) {
                throw new IllegalArgumentException("BODY parameter must have no header name specifier (${body:" + type + "}, not  (${body." + header + ":" + type + "}");
            }
        }
        final Parameter parameter = new Parameter(header, dataType);
        parameters.add(parameter);
        log.trace("Parameter: {}", parameter);
    }

    this.sql = m.replaceAll("?");
    log.debug("Generated SQL: {}", this.sql);
}
项目:SimpleFlatMapper    文件:JooqMapperBuilder.java   
protected FakeField(String name) {
    super(name, new DefaultDataType<Object>(SQLDialect.DEFAULT, Object.class, "varchar"));
}