@Override public final Object[] fetchAnyArray() { R record = fetchAny(); return record == null ? null : record.intoArray(); }
@Override public final Object[] fetchSingleArray() { return fetchSingle().intoArray(); }
@Override public final Object[] fetchOneArray() { R record = fetchOne(); return record == null ? null : record.intoArray(); }
@Override public final Object[] fetchOneArray() { R record = fetchOne(); return record == null ? null : record.intoArray(); }
@Override public final Object[][] intoArrays() { int size = size(); Object[][] array = new Object[size][]; for (int i = 0; i < size; i++) { array[i] = get(i).intoArray(); } return array; }
@Override public final Object[][] intoArray() { int size = size(); Object[][] array = new Object[size][]; for (int i = 0; i < size; i++) { array[i] = get(i).intoArray(); } return array; }
@Override public final Condition and(Record record) { RowN r = new RowImpl(Tools.fields(record.intoArray(), record.fields())); return and(r); }
@Override public final Condition and(Record record) { RowN r = new RowImpl(Utils.fields(record.intoArray(), record.fields())); return and(r); }
@Override public final void formatInsert(Writer writer, Table<?> table, Field<?>... f) { DSLContext ctx = configuration.dsl(); try { for (R record : this) { if (table == null) if (record instanceof TableRecord) table = ((TableRecord<?>) record).getTable(); else table = table(name("UNKNOWN_TABLE")); writer.append(ctx.renderInlined(insertInto(table, f).values(record.intoArray()))) .append(";\n"); } writer.flush(); } catch (java.io.IOException e) { throw new IOException("Exception while writing INSERTs", e); } }
@Override public EXECUTE insert(Collection<P> pojos, boolean onDuplicateKeyIgnore) { Arguments.require(!pojos.isEmpty(), "No elements"); return queryExecutor().execute(dslContext -> { InsertSetStep<R> insertSetStep = dslContext.insertInto(getTable()); InsertValuesStepN<R> insertValuesStepN = null; for (P pojo : pojos) { insertValuesStepN = insertSetStep.values(newRecord(dslContext, pojo).intoArray()); } return onDuplicateKeyIgnore?insertValuesStepN.onDuplicateKeyIgnore():insertValuesStepN; }); }
@Override public EXECUTE insert(Collection<P> pojos, boolean onDuplicateKeyIgnore) { Arguments.require(!pojos.isEmpty(), "No elements"); return queryExecutor().execute(dslContext -> { InsertSetStep<R> insertSetStep = dslContext.insertInto(getTable()); InsertValuesStepN<R> insertValuesStepN = null; for (P pojo : pojos) { insertValuesStepN = insertSetStep.values(newRecord(dslContext, pojo).intoArray()); } return onDuplicateKeyIgnore?insertValuesStepN.onDuplicateKeyIgnore():insertValuesStepN; }); }