當前位置: 首頁>>代碼示例>>Java>>正文


Java SQLDialect.POSTGRES屬性代碼示例

本文整理匯總了Java中org.jooq.SQLDialect.POSTGRES屬性的典型用法代碼示例。如果您正苦於以下問題:Java SQLDialect.POSTGRES屬性的具體用法?Java SQLDialect.POSTGRES怎麽用?Java SQLDialect.POSTGRES使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.jooq.SQLDialect的用法示例。


在下文中一共展示了SQLDialect.POSTGRES屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: determineSearcher

private FullTextSearch<Application> determineSearcher(SQLDialect dialect) {

        if (dialect == SQLDialect.POSTGRES) {
            return new PostgresAppSearch();
        }

        if (dialect == SQLDialect.MARIADB) {
            return new MariaAppSearch();
        }

        if (dialect.name().startsWith("SQLSERVER")) {
            return new SqlServerAppSearch();
        }

        return new UnsupportedSearcher<>(dialect);
    }
 
開發者ID:khartec,項目名稱:waltz,代碼行數:16,代碼來源:ApplicationSearchDao.java

示例2: determineSearcher

private FullTextSearch<OrganisationalUnit> determineSearcher(SQLDialect dialect) {

        if (dialect == SQLDialect.POSTGRES) {
            return new PostgresOrganisationalUnitSearch();
        }

        if (dialect == SQLDialect.MARIADB) {
            return new MariaOrganisationalUnitSearch();
        }

        // cannot do direct comparison as may not be present.
        if (dialect.name().equals("SQLSERVER2014")) {
            return new SqlServerOrganisationalUnitSearch();
        }

        return new UnsupportedSearcher<>(dialect);
    }
 
開發者ID:khartec,項目名稱:waltz,代碼行數:17,代碼來源:OrganisationalUnitSearchDao.java

示例3: determineSearcher

private FullTextSearch<ChangeInitiative> determineSearcher(SQLDialect dialect) {

        if (dialect == SQLDialect.POSTGRES) {
            return new PostgresChangeInitiativeSearch();
        }

        if (dialect == SQLDialect.MARIADB) {
            return new MariaChangeInitiativeSearch();
        }

        if (dialect.name().startsWith("SQLSERVER")) {
            return new SqlServerChangeInitiativeSearch();
        }

        return new UnsupportedSearcher<>(dialect);
    }
 
開發者ID:khartec,項目名稱:waltz,代碼行數:16,代碼來源:ChangeInitiativeSearchDao.java

示例4: determineSearcher

private FullTextSearch<Measurable> determineSearcher(SQLDialect dialect) {

        if (dialect == SQLDialect.POSTGRES) {
            return new PostgresMeasurableSearch();
        }

        if (dialect == SQLDialect.MARIADB) {
            return new MariaMeasurableSearch();
        }

        if (dialect.name().startsWith("SQLSERVER")) {
            return new SqlServerMeasurableSearch();
        }

        return new UnsupportedSearcher<>(dialect);
    }
 
開發者ID:khartec,項目名稱:waltz,代碼行數:16,代碼來源:MeasurableSearchDao.java

示例5: determineSearcher

private FullTextSearch<Person> determineSearcher(SQLDialect dialect) {

        if (dialect == SQLDialect.POSTGRES) {
            return new PostgresPersonSearch();
        }

        if (dialect == SQLDialect.MARIADB) {
            return new MariaPersonSearch();
        }

        if (dialect.name().equals("SQLSERVER2014")) {
            return new SqlServerPersonSearch();
        }

        return new UnsupportedSearcher<>(dialect);
    }
 
開發者ID:khartec,項目名稱:waltz,代碼行數:16,代碼來源:PersonSearchDao.java

示例6: should_not_contain_where_clause_on_submissions

@Test
public void should_not_contain_where_clause_on_submissions() throws Exception {
    // given
    SubmissionListFilter filter = new SubmissionListFilter();
    filter.getStatuses().setStatuses(new ArrayList<>());
    final DSLContext create = new DefaultDSLContext(SQLDialect.POSTGRES);
    final SelectJoinStep step = create.select().from();

    // when
    SubmissionFilterAppender.appendOn(filter, step);

    // then
    assertThat("should not contain where clause on submissions",
               step.getSQL(),
               not(containsString("where 1 = 0")));
}
 
開發者ID:kTT,項目名稱:adjule,代碼行數:16,代碼來源:SubmissionFilterAppenderTest.java

示例7: detectSqlDialect

private SQLDialect detectSqlDialect(DataSource dataSource) throws SQLException {
    String databaseProductName;
    try (Connection conn = dataSource.getConnection()) {
        databaseProductName = conn.getMetaData().getDatabaseProductName();
    }

    if ("H2".equalsIgnoreCase(databaseProductName)) {
        return SQLDialect.H2;
    } else if ("MySQL".equalsIgnoreCase(databaseProductName)) {
        return SQLDialect.MARIADB;
    } else if ("PostgreSQL".equalsIgnoreCase(databaseProductName)) {
        return SQLDialect.POSTGRES;
    }
    throw new IllegalArgumentException("Unknown DB dialect: " + databaseProductName);
}
 
開發者ID:SolarNetwork,項目名稱:killbill-easytax-plugin,代碼行數:15,代碼來源:EasyTaxActivator.java

示例8: getJooqSqlDialect

private SQLDialect getJooqSqlDialect() {
    switch (this.dialect) {
        case MySql:
            return SQLDialect.MYSQL;
        case Postgres:
            return SQLDialect.POSTGRES;
    }
    throw new UnsupportedOperationException();
}
 
開發者ID:ShotaOd,項目名稱:carbon,代碼行數:9,代碼來源:JooqCodeGenerator.java

示例9: parameters

@Parameters(name = "{0}")
public static Object[] parameters() {
	return new Object[] { new Object[] { SQLDialect.DERBY, sqlException("42802") },
			new Object[] { SQLDialect.H2, sqlException(42000) },
			new Object[] { SQLDialect.HSQLDB, sqlException(-22) },
			new Object[] { SQLDialect.MARIADB, sqlException(1054) },
			new Object[] { SQLDialect.MYSQL, sqlException(1054) },
			new Object[] { SQLDialect.POSTGRES, sqlException("03000") },
			new Object[] { SQLDialect.POSTGRES_9_3, sqlException("03000") },
			new Object[] { SQLDialect.POSTGRES_9_4, sqlException("03000") },
			new Object[] { SQLDialect.POSTGRES_9_5, sqlException("03000") } };
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:12,代碼來源:JooqExceptionTranslatorTests.java

示例10: main

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,代碼行數:29,代碼來源:App.java

示例11: getSettings

@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,代碼行數:14,代碼來源:ConfiguredConnector.java

示例12: SQLDialectFromDBEngine

private static SQLDialect SQLDialectFromDBEngine(final EmbeddedDB.DBEngine dbEngine) {
    switch (dbEngine) {
        case H2:
            return SQLDialect.H2;
        case MYSQL:
            return SQLDialect.MARIADB;
        case POSTGRESQL:
            return SQLDialect.POSTGRES;
        default:
            throw new IllegalArgumentException("Unsupported DB engine: " + dbEngine);
    }
}
 
開發者ID:killbill,項目名稱:killbill-analytics-plugin,代碼行數:12,代碼來源:SqlReportDataExtractor.java

示例13: getSQLDialect

@Override
protected SQLDialect getSQLDialect()
{
    return SQLDialect.POSTGRES;
}
 
開發者ID:apache,項目名稱:polygene-java,代碼行數:5,代碼來源:PostgreSQLEntityStoreAssembler.java

示例14: arrayAgg

/**
 * Applies the {@code array_agg} aggregate function on a field,
 * resulting in the input values being concatenated into an array.
 *
 * @param field the field to be aggregated
 * @param <T> the type of the field
 * @return a {@link Field} representing the array aggregate.
 *
 * @see <a href="http://www.postgresql.org/docs/9.3/static/functions-aggregate.html"/>
 */
@Support({SQLDialect.POSTGRES})
public static <T> Field<T[]> arrayAgg(Field<T> field) {
    return DSL.field("array_agg({0})", field.getDataType().getArrayDataType(), field);
}
 
開發者ID:benjamin-bader,項目名稱:droptools,代碼行數:14,代碼來源:PostgresSupport.java

示例15: arrayAggNoNulls

/**
 * Like {@link #arrayAgg}, but uses {@code array_remove} to eliminate
 * SQL {@code NULL} values from the result.
 *
 * @param field the field to be aggregated
 * @param <T> the type of the field
 * @return a {@link Field} representing the array aggregate
 *
 * @see <a href="http://www.postgresql.org/docs/9.3/static/functions-aggregate.html"/>
 */
@Support({SQLDialect.POSTGRES})
public static <T> Field<T[]> arrayAggNoNulls(Field<T> field) {
    return DSL.field("array_remove(array_agg({0}), NULL)", field.getDataType().getArrayType(), field);
}
 
開發者ID:benjamin-bader,項目名稱:droptools,代碼行數:14,代碼來源:PostgresSupport.java


注:本文中的org.jooq.SQLDialect.POSTGRES屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。