From 2fa49af23d00a035d3f436d8771f777b8320e168 Mon Sep 17 00:00:00 2001 From: Christopher Mohr Date: Fri, 26 Mar 2021 09:40:57 +0100 Subject: [PATCH] Add comment to explain use of query values --- .../qbic/variantstore/database/MariaDBVariantstoreStorage.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/groovy/life/qbic/variantstore/database/MariaDBVariantstoreStorage.groovy b/src/main/groovy/life/qbic/variantstore/database/MariaDBVariantstoreStorage.groovy index 9f5d057..21b6938 100644 --- a/src/main/groovy/life/qbic/variantstore/database/MariaDBVariantstoreStorage.groovy +++ b/src/main/groovy/life/qbic/variantstore/database/MariaDBVariantstoreStorage.groovy @@ -2026,6 +2026,7 @@ gene.id = consequence_has_gene.gene_id INNER JOIN consequence on consequence_has sql.withBatch("insert INTO gene (symbol, name, biotype, chr, start, end, synonyms, geneid, description, strand, version) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE symbol=?, name=?, biotype=?, chr=?, start=?, end=?, synonyms=?, geneid=?, description=?, strand=?, version=?") { BatchingPreparedStatementWrapper ps -> genes.each { gene -> + // we have to specify the values twice since we need them for the insert and "on duplicate" part of the sql query ps.addBatch([gene.symbol, gene.name, gene.bioType, gene.chromosome, gene.geneStart, gene.geneEnd, gene.synonyms[0], gene.geneId, gene.description, gene.strand, gene.version, gene.symbol, gene.name, gene.bioType, gene.chromosome, gene.geneStart,