final Select<Record> insertSelect() { Select<Record> select = null; for (int row = 0; row < rows; row++) { List<Field<?>> fields = new ArrayList<Field<?>>(values.size()); for (List<Field<?>> list : values.values()) fields.add(list.get(row)); Select<Record> iteration = DSL.select(fields); if (select == null) select = iteration; else select = select.unionAll(iteration); } return select; }
@Override public final SelectImpl unionAll(Select<? extends R> select) { return new SelectImpl(getDelegate().unionAll(select)); }
@Override public final SelectImpl unionAll(Select<? extends R> select) { return new SelectImpl(getDelegate().unionAll(select)); }
private final Select<Record> insertSelect(RenderContext context) { Select<Record> select = null; for (FieldMapForInsert map : insertMaps) { if (map != null) { Select<Record> iteration = DSL.using(context.configuration()).select(map.values()); if (select == null) { select = iteration; } else { select = select.unionAll(iteration); } } } return select; }
rows = row; else rows = rows.unionAll(row);
@SuppressWarnings("unchecked") private Select createQuery( DSLContext dsl, Select query, Set<Field<?>> fields, org.jooq.Table<?> joinTable, DocStructure docStructure, SubDocTable subDocTable, Field<Integer> rootSidField, Map.Entry<Integer, DocStructure> entry) { Condition indexCondition; if (docStructure.getIndex() == 0) { indexCondition = subDocTable.getIndexColumn().isNull(); } else { indexCondition = subDocTable.getIndexColumn().eq(docStructure.getIndex()); } Select subQuery = dsl.select(fields).from(joinTable).where( rootSidField.eq(DSL.val(entry.getKey()).cast(Integer.class)) .and(indexCondition)); Select newQuery; if (query == null) { newQuery = subQuery; } else { newQuery = query.unionAll(subQuery); } return newQuery; }
private final Table<Record> table(Configuration configuration) { if (table == null) { Select<Record> select = null; for (Object element : array) { // [#1081] Be sure to get the correct cast type also for null Field<?> val = DSL.val(element, field.fields[0].getDataType()); Select<Record> subselect = using(configuration).select(val.as("COLUMN_VALUE")).select(); if (select == null) { select = subselect; } else { select = select.unionAll(subselect); } } // Empty arrays should result in empty tables if (select == null) { select = using(configuration).select(one().as("COLUMN_VALUE")).select().where(falseCondition()); } table = select.asTable(alias); } return table; } }
private final Table<Record> table(Configuration configuration) { if (table == null) { Select<Record> select = null; for (Object element : array) { // [#1081] Be sure to get the correct cast type also for null Field<?> val = DSL.val(element, field.fields[0].getDataType()); Select<Record> subselect = using(configuration).select(val.as("COLUMN_VALUE")).select(); if (select == null) { select = subselect; } else { select = select.unionAll(subselect); } } // Empty arrays should result in empty tables if (select == null) { select = using(configuration).select(one().as("COLUMN_VALUE")).select().where(falseCondition()); } table = DSL.table(select).as(alias); } return table; } }
select = select(val(value)); else select = select.unionAll(select(val(value)));
selects = select; else selects = selects.unionAll(select);
selects = selects.unionAll(select);