Search in sources :

Example 1 with InBuilder

use of org.sql.generation.api.grammar.builders.booleans.InBuilder in project qi4j-sdk by Qi4j.

the class AbstractSQLQuerying method createTypeCondition.

protected org.sql.generation.api.grammar.booleans.BooleanExpression createTypeCondition(Class<?> resultType, SQLVendor vendor) {
    BooleanFactory b = vendor.getBooleanFactory();
    LiteralFactory l = vendor.getLiteralFactory();
    ColumnsFactory c = vendor.getColumnsFactory();
    List<Integer> typeIDs = this.getEntityTypeIDs(resultType);
    InBuilder in = b.inBuilder(c.colName(TABLE_NAME_PREFIX + TYPE_TABLE_SUFFIX, DBNames.ENTITY_TYPES_TABLE_PK_COLUMN_NAME));
    for (Integer i : typeIDs) {
        in.addValues(l.n(i));
    }
    return in.createExpression();
}
Also used : ColumnsFactory(org.sql.generation.api.grammar.factories.ColumnsFactory) InBuilder(org.sql.generation.api.grammar.builders.booleans.InBuilder) BooleanFactory(org.sql.generation.api.grammar.factories.BooleanFactory) LiteralFactory(org.sql.generation.api.grammar.factories.LiteralFactory)

Aggregations

InBuilder (org.sql.generation.api.grammar.builders.booleans.InBuilder)1 BooleanFactory (org.sql.generation.api.grammar.factories.BooleanFactory)1 ColumnsFactory (org.sql.generation.api.grammar.factories.ColumnsFactory)1 LiteralFactory (org.sql.generation.api.grammar.factories.LiteralFactory)1