Search in sources :

Example 1 with InsertValuesStep12

use of org.jooq.InsertValuesStep12 in project hmftools by hartwigmedical.

the class CopyNumberDAO method writeGermlineCopyNumber.

void writeGermlineCopyNumber(@NotNull final String sample, @NotNull List<PurpleCopyNumber> copyNumbers) {
    Timestamp timestamp = new Timestamp(new Date().getTime());
    context.delete(COPYNUMBERGERMLINE).where(COPYNUMBERGERMLINE.SAMPLEID.eq(sample)).execute();
    for (List<PurpleCopyNumber> splitCopyNumbers : Iterables.partition(copyNumbers, DB_BATCH_INSERT_SIZE)) {
        InsertValuesStep12 inserter = context.insertInto(COPYNUMBERGERMLINE, COPYNUMBERGERMLINE.SAMPLEID, COPYNUMBERGERMLINE.CHROMOSOME, COPYNUMBERGERMLINE.START, COPYNUMBERGERMLINE.END, COPYNUMBERGERMLINE.COPYNUMBERMETHOD, COPYNUMBERGERMLINE.SEGMENTSTARTSUPPORT, COPYNUMBERGERMLINE.SEGMENTENDSUPPORT, COPYNUMBERGERMLINE.BAFCOUNT, COPYNUMBERGERMLINE.OBSERVEDBAF, COPYNUMBERGERMLINE.ACTUALBAF, COPYNUMBERGERMLINE.COPYNUMBER, COPYNUMBERGERMLINE.MODIFIED);
        splitCopyNumbers.forEach(x -> addCopynumberRecord(timestamp, inserter, sample, x));
        inserter.execute();
    }
}
Also used : InsertValuesStep12(org.jooq.InsertValuesStep12) Timestamp(java.sql.Timestamp) ImmutablePurpleCopyNumber(com.hartwig.hmftools.common.purple.copynumber.ImmutablePurpleCopyNumber) PurpleCopyNumber(com.hartwig.hmftools.common.purple.copynumber.PurpleCopyNumber) Date(java.util.Date)

Example 2 with InsertValuesStep12

use of org.jooq.InsertValuesStep12 in project hmftools by hartwigmedical.

the class CopyNumberDAO method writeCopyNumber.

void writeCopyNumber(@NotNull final String sample, @NotNull List<PurpleCopyNumber> copyNumbers) {
    Timestamp timestamp = new Timestamp(new Date().getTime());
    context.delete(COPYNUMBER).where(COPYNUMBER.SAMPLEID.eq(sample)).execute();
    for (List<PurpleCopyNumber> splitCopyNumbers : Iterables.partition(copyNumbers, DB_BATCH_INSERT_SIZE)) {
        InsertValuesStep12 inserter = context.insertInto(COPYNUMBER, COPYNUMBER.SAMPLEID, COPYNUMBER.CHROMOSOME, COPYNUMBER.START, COPYNUMBER.END, COPYNUMBER.COPYNUMBERMETHOD, COPYNUMBER.SEGMENTSTARTSUPPORT, COPYNUMBER.SEGMENTENDSUPPORT, COPYNUMBER.BAFCOUNT, COPYNUMBER.OBSERVEDBAF, COPYNUMBER.ACTUALBAF, COPYNUMBER.COPYNUMBER_, COPYNUMBER.MODIFIED);
        splitCopyNumbers.forEach(x -> addCopynumberRecord(timestamp, inserter, sample, x));
        inserter.execute();
    }
}
Also used : InsertValuesStep12(org.jooq.InsertValuesStep12) Timestamp(java.sql.Timestamp) ImmutablePurpleCopyNumber(com.hartwig.hmftools.common.purple.copynumber.ImmutablePurpleCopyNumber) PurpleCopyNumber(com.hartwig.hmftools.common.purple.copynumber.PurpleCopyNumber) Date(java.util.Date)

Aggregations

ImmutablePurpleCopyNumber (com.hartwig.hmftools.common.purple.copynumber.ImmutablePurpleCopyNumber)2 PurpleCopyNumber (com.hartwig.hmftools.common.purple.copynumber.PurpleCopyNumber)2 Timestamp (java.sql.Timestamp)2 Date (java.util.Date)2 InsertValuesStep12 (org.jooq.InsertValuesStep12)2