Java Code Examples for org.jooq.SQLDialect#POSTGRES

The following examples show how to use org.jooq.SQLDialect#POSTGRES . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JooqJobActivityConnectorComponent.java    From titus-control-plane with Apache License 2.0 4 votes vote down vote up
@Bean
public SQLDialect dialect() {
    return SQLDialect.POSTGRES;
}
 
Example 2
Source File: PostgreSQLEntityStoreAssembler.java    From attic-polygene-java with Apache License 2.0 4 votes vote down vote up
@Override
protected SQLDialect getSQLDialect()
{
    return SQLDialect.POSTGRES;
}
 
Example 3
Source File: PostgresSupport.java    From droptools with Apache License 2.0 2 votes vote down vote up
/**
 * 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"></a>
 */
@Support({SQLDialect.POSTGRES})
public static <T> Field<T[]> arrayAgg(Field<T> field) {
    return DSL.field("array_agg({0})", field.getDataType().getArrayDataType(), field);
}
 
Example 4
Source File: PostgresSupport.java    From droptools with Apache License 2.0 2 votes vote down vote up
/**
 * 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"></a>
 */
@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);
}
 
Example 5
Source File: PostgresSupport.java    From droptools with Apache License 2.0 2 votes vote down vote up
/**
 * Joins a set of string values using the given delimiter.
 *
 * @param field the field to be concatenated
 * @param delimiter the separating delimiter
 * @return a {@link Field} representing the joined string
 */
@Support({SQLDialect.POSTGRES})
public static Field<String> stringAgg(Field<String> field, String delimiter) {
    return DSL.field("string_agg({0}, {1})", field.getDataType(), field, DSL.val(delimiter));
}