当前位置: 首页>>代码示例>>Java>>正文


Java RenderNameStyle类代码示例

本文整理汇总了Java中org.jooq.conf.RenderNameStyle的典型用法代码示例。如果您正苦于以下问题:Java RenderNameStyle类的具体用法?Java RenderNameStyle怎么用?Java RenderNameStyle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RenderNameStyle类属于org.jooq.conf包,在下文中一共展示了RenderNameStyle类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
public void setUp() throws Exception {
  connection = DriverManager.getConnection("jdbc:hsqldb:mem:myDb");
  context = DSL.using(connection, SQLDialect.HSQLDB, new Settings().withRenderNameStyle(
      RenderNameStyle.AS_IS));

  final List<Field<String>> fields = getFields();

  context.createTable(relationName)
      .columns(fields)
      .execute();

  try (InputStream in = resourceClass.getResourceAsStream(csvPath)) {
    final Loader<Record> loader = context.loadInto(table(name(relationName)))
        .loadCSV(in)
        .fields(fields)
        .execute();

    assertThat(loader.errors()).isEmpty();
  }
}
 
开发者ID:HPI-Information-Systems,项目名称:AdvancedDataProfilingSeminar,代码行数:21,代码来源:TestDatabase.java

示例2: SqlReportDataExtractor

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
public SqlReportDataExtractor(final String tableName,
                              final ReportSpecification reportSpecification,
                              @Nullable final DateTime startDate,
                              @Nullable final DateTime endDate,
                              final SQLDialect sqlDialect,
                              final Long tenantRecordId) {
    this.tableName = tableName;
    this.reportSpecification = reportSpecification;
    this.startDate = startDate;
    this.endDate = endDate;
    this.tenantRecordId = tenantRecordId;

    final Settings settings = new Settings();
    settings.withStatementType(StatementType.STATIC_STATEMENT);
    settings.withRenderFormatted(true);
    if (SQLDialect.H2.equals(sqlDialect)) {
        settings.withRenderNameStyle(RenderNameStyle.AS_IS);
    }
    this.context = DSL.using(sqlDialect, settings);

    setup();
}
 
开发者ID:killbill,项目名称:killbill-analytics-plugin,代码行数:23,代码来源:SqlReportDataExtractor.java

示例3: jooqSettings

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
@Bean
@Primary
public Settings jooqSettings() {
    Settings ret = new Settings();
    ret.withRenderSchema(false);
    ret.setRenderFormatted(true);

    ret.setRenderNameStyle(RenderNameStyle.AS_IS);
    return ret;
}
 
开发者ID:bwajtr,项目名称:java-persistence-frameworks-comparison,代码行数:11,代码来源:DbTestsApplication.java

示例4: databaseAgnostic

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
public static DSLContext databaseAgnostic(DataSource dataSource) throws SQLException {
SQLDialect dialect;
try (Connection conn = dataSource.getConnection()) {
  dialect = dialect(conn);

  // See https://github.com/jOOQ/jOOQ/issues/4730
  if (conn.getMetaData().getURL().startsWith("jdbc:pgsql:")) {
    dialect = POSTGRES;
  }
}
return DSL.using(dataSource, dialect,
        new Settings()
            .withRenderSchema(false)
            .withRenderNameStyle(RenderNameStyle.AS_IS));
}
 
开发者ID:square,项目名称:keywhiz,代码行数:16,代码来源:DSLContexts.java

示例5: main

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
public static void main(String[] args) {
	SQLDialect sqlDialect = args.length == 0 ? SQLDialect.HSQLDB : SQLDialect.POSTGRES; // SQLDialect.ORACLE

	Settings settings = new Settings()
		.withRenderFormatted(true)
		.withRenderSchema(TRUE)
		.withRenderNameStyle(RenderNameStyle.UPPER);
	if (sqlDialect == SQLDialect.POSTGRES) {
		String schema1Name = args[0];
		String schema2Name = args[1];
		settings.withRenderMapping(new RenderMapping()
			.withSchemata(
				new MappedSchema().withInput(SCHEMA1.getName()).withOutput(schema1Name),
				new MappedSchema().withInput(SCHEMA2.getName()).withOutput(schema2Name)));
	}
	
	Configuration config = new DefaultConfiguration()
		.set(sqlDialect)
		.set(settings);

	Configuration configuration = config;
	DSLContext dsl = DSL.using(configuration);

	System.out.println(
		dsl.select(A.ID, A.FLAG)
			.from(A)
			.join(B).on(B.NAME.eq(A.NAME))
			.toString());
}
 
开发者ID:stanislas,项目名称:jooq-with-liquibase,代码行数:30,代码来源:App.java

示例6: dbSetting

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
private static Settings dbSetting(String name) {
    String prop = "db." + name + ".database";
    String database = ArchaiusUtil.getString(prop).get();

    Settings settings = new Settings();
    settings.setRenderSchema(false);
    settings.setExecuteLogging(false);

    String renderNameStyle = ArchaiusUtil.getString("db." + name + "." + database + ".render.name.style").get();
    if (renderNameStyle != null) {
        settings.setRenderNameStyle(RenderNameStyle.valueOf(renderNameStyle.trim().toUpperCase()));
    }

    return settings;
}
 
开发者ID:rancher,项目名称:cattle,代码行数:16,代码来源:Bootstrap.java

示例7: init

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
@PostConstruct
public void init() {
    String prop = "db." + name + ".database";
    String database = ArchaiusUtil.getString(prop).get();
    if ( database == null ) {
        throw new IllegalStateException("Failed to find config for [" + prop + "]");
    }

    try {
        SQLDialect dialect = SQLDialect.valueOf(database.trim().toUpperCase());
        set(dialect);
    } catch ( IllegalArgumentException e ) {
        throw new IllegalArgumentException("Invalid SQLDialect [" + database.toUpperCase() + "]", e);
    }

    if ( connectionProvider == null ) {
        set(new AutoCommitConnectionProvider(dataSource));
    } else {
        set(connectionProvider);
    }

    settings.setRenderSchema(false);

    String renderNameStyle = ArchaiusUtil.getString("db." + name + "." + database + ".render.name.style").get();
    if ( renderNameStyle != null ) {
        settings.setRenderNameStyle(RenderNameStyle.valueOf(renderNameStyle.trim().toUpperCase()));
    }

    set(settings);

    if ( listeners != null && listeners.size() > 0 ) {
        settings().setExecuteLogging(false);
        set(DefaultExecuteListenerProvider.providers(listeners.toArray(new ExecuteListener[listeners.size()])));
    }
}
 
开发者ID:cloudnautique,项目名称:cloud-cattle,代码行数:36,代码来源:Configuration.java

示例8: getSettings

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
@Override
public Settings getSettings() {
    if(dialect == SQLDialect.POSTGRES) {
        return new Settings().withRenderNameStyle(RenderNameStyle.LOWER);
    }
    return updateSchema(dialect).map(s ->
            new Settings()
                    .withRenderNameStyle(RenderNameStyle.LOWER)
                    .withRenderMapping(new RenderMapping()
                    .withSchemata(
                        new MappedSchema().withInput(Club.CLUB.getName())
                                .withOutput(s))))
                .orElseGet(Settings::new);
}
 
开发者ID:AveryRegier,项目名称:club-tracker,代码行数:15,代码来源:ConfiguredConnector.java

示例9: init

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
@PostConstruct
public void init() {
    String prop = "db." + name + ".database";
    String database = ArchaiusUtil.getString(prop).get();
    if ( database == null ) {
        throw new IllegalStateException("Failed to find config for [" + prop + "]");
    }

    try {
        SQLDialect dialect = SQLDialect.valueOf(database.trim().toUpperCase());
        set(dialect);
    } catch ( IllegalArgumentException e ) {
        throw new IllegalArgumentException("Invalid SQLDialect [" + database.toUpperCase() + "]", e);
    }

    if ( connectionProvider == null ) {
        set(new AutoCommitConnectionProvider(dataSource));
    } else {
        set(connectionProvider);
    }

    Settings settings = new Settings();
    settings.setRenderSchema(false);

    String renderNameStyle = ArchaiusUtil.getString("db." + name + "." + database + ".render.name.style").get();
    if ( renderNameStyle != null ) {
        settings.setRenderNameStyle(RenderNameStyle.valueOf(renderNameStyle.trim().toUpperCase()));
    }

    set(settings);

    if ( listeners != null && listeners.size() > 0 ) {
        settings().setExecuteLogging(false);
        set(DefaultExecuteListenerProvider.providers(listeners.toArray(new ExecuteListener[listeners.size()])));
    }
}
 
开发者ID:ibuildthecloud,项目名称:dstack,代码行数:37,代码来源:Configuration.java

示例10: hsqldb

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
private DSLContext hsqldb(final Connection connection) {
  final Settings settings = new Settings().withRenderNameStyle(RenderNameStyle.AS_IS);
  return DSL.using(connection, SQLDialect.HSQLDB, settings);
}
 
开发者ID:HPI-Information-Systems,项目名称:AdvancedDataProfilingSeminar,代码行数:5,代码来源:DSLContextFactory.java

示例11: startServer

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
/**
 * This method reads the configuration properties from
 * your application.conf file and configures jOOQ accordingly.
 * 
 */
public final void startServer(){
    logger.info("Starting jOOQ Module.");

    // Setup basic parameters
    boolean renderSchema = ninjaProperties.getBooleanWithDefault(JOOQ_RENDER_SCHEMA, true);

    //renderMapping

    String renderNameStyleString = ninjaProperties.getWithDefault(JOOQ_RENDER_NAME_STYLE, "QUOTED");
    RenderNameStyle renderNameStyle = RenderNameStyle.fromValue(renderNameStyleString);
    String renderKeywordStyleString = ninjaProperties.getWithDefault(JOOQ_RENDER_KEYWORD_STYLE, "LOWER");
    RenderKeywordStyle renderKeywordStyle = RenderKeywordStyle.valueOf(renderKeywordStyleString);

    boolean renderFormatted = ninjaProperties.getBooleanWithDefault(JOOQ_RENDER_FORMATTED, false);

    String statementTypeString = ninjaProperties.getWithDefault(JOOQ_STATEMENT_TYPE, "PREPARED_STATEMENT");
    StatementType statementType = StatementType.valueOf(statementTypeString);

    boolean executeLogging = ninjaProperties.getBooleanWithDefault(JOOQ_EXECUTE_LOGGING, true);

    // Execute listeners

    boolean executeWithOptimisticLocking = ninjaProperties
            .getBooleanWithDefault(JOOQ_EXECUTE_WITH_OPTIMISTIC_LOCKING, true);

    boolean attachRecords = ninjaProperties.getBooleanWithDefault(JOOQ_ATTACH_RECORDS, true);

    String sqlDialectString = ninjaProperties.getWithDefault(JOOQ_SQL_DIALECT, "DEFAULT");
    SQLDialect sqlDialect = SQLDialect.valueOf(sqlDialectString);

    Settings settings = new Settings();
    settings.setRenderSchema(renderSchema);
    settings.setRenderNameStyle(renderNameStyle);
    settings.setRenderKeywordStyle(renderKeywordStyle);
    settings.setRenderFormatted(renderFormatted);
    settings.setStatementType(statementType);
    settings.setExecuteLogging(executeLogging);
    settings.setExecuteWithOptimisticLocking(executeWithOptimisticLocking);
    settings.setAttachRecords(attachRecords);

    String connectionUrl = ninjaProperties.getOrDie(NinjaConstant.DB_CONNECTION_URL);
    String connectionUsername = ninjaProperties.getOrDie(NinjaConstant.DB_CONNECTION_USERNAME);
    String connectionPassword = ninjaProperties.getWithDefault(NinjaConstant.DB_CONNECTION_PASSWORD, "");

    BasicDataSource connectionPool = new BasicDataSource();

    connectionPool.setUrl(connectionUrl);
    connectionPool.setUsername(connectionUsername);
    connectionPool.setPassword(connectionPassword);

    Configuration configuration = new DefaultConfiguration();
    configuration.set(sqlDialect);
    configuration.set(settings);
    configuration.set(connectionPool);

    dslContext = DSL.using(configuration);
}
 
开发者ID:jschaf,项目名称:ninja-jooq,代码行数:63,代码来源:NinjaJooqLifecycle.java

示例12: withRenderNameStyle

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
public SelectBuilder<T> withRenderNameStyle(RenderNameStyle renderNameStyle) {
  this.renderNameStyle = renderNameStyle;
  return this;
}
 
开发者ID:HubSpot,项目名称:httpQL,代码行数:5,代码来源:SelectBuilder.java

示例13: getSettings

import org.jooq.conf.RenderNameStyle; //导入依赖的package包/类
protected Settings getSettings()
{
    return new Settings().withRenderNameStyle( RenderNameStyle.QUOTED );
}
 
开发者ID:apache,项目名称:polygene-java,代码行数:5,代码来源:AbstractSQLEntityStoreAssembler.java


注:本文中的org.jooq.conf.RenderNameStyle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。