當前位置: 首頁>>代碼示例>>Java>>正文


Java InsertValuesStep2類代碼示例

本文整理匯總了Java中org.jooq.InsertValuesStep2的典型用法代碼示例。如果您正苦於以下問題:Java InsertValuesStep2類的具體用法?Java InsertValuesStep2怎麽用?Java InsertValuesStep2使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


InsertValuesStep2類屬於org.jooq包,在下文中一共展示了InsertValuesStep2類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createRoles

import org.jooq.InsertValuesStep2; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public void createRoles(DynamicSchema dynamicSchema) {
    List<String> roles = (List<String>) CollectionUtils.toList(CollectionUtils.getNestedValue(dynamicSchema.getData(),
            "fields", "roles"));
    InsertValuesStep2<DynamicSchemaRoleRecord, Long, String> insertStart = create()
            .insertInto(DYNAMIC_SCHEMA_ROLE, DYNAMIC_SCHEMA_ROLE.DYNAMIC_SCHEMA_ID, DYNAMIC_SCHEMA_ROLE.ROLE);
    for (String role: roles) {
                insertStart = insertStart.values(dynamicSchema.getId(), role);
    }
    insertStart.execute();
}
 
開發者ID:rancher,項目名稱:cattle,代碼行數:13,代碼來源:DynamicSchemaDaoImpl.java

示例2: write

import org.jooq.InsertValuesStep2; //導入依賴的package包/類
@SuppressWarnings("unchecked")
public void write(final StructuralVariantAnalysis analysis) {
    final Timestamp timestamp = new Timestamp(new Date().getTime());

    final Map<Transcript, Integer> id = Maps.newHashMap();

    // NERA: load transcript annotations
    for (final StructuralVariantAnnotation annotation : analysis.annotations()) {
        for (final GeneAnnotation geneAnnotation : annotation.annotations()) {
            final InsertValuesStep13 inserter = context.insertInto(STRUCTURALVARIANTBREAKEND,
                    STRUCTURALVARIANTBREAKEND.MODIFIED,
                    STRUCTURALVARIANTBREAKEND.ISSTARTEND,
                    STRUCTURALVARIANTBREAKEND.STRUCTURALVARIANTID,
                    STRUCTURALVARIANTBREAKEND.GENE,
                    STRUCTURALVARIANTBREAKEND.GENEID,
                    STRUCTURALVARIANTBREAKEND.TRANSCRIPTID,
                    STRUCTURALVARIANTBREAKEND.ISCANONICALTRANSCRIPT,
                    STRUCTURALVARIANTBREAKEND.STRAND,
                    STRUCTURALVARIANTBREAKEND.EXONRANKUPSTREAM,
                    STRUCTURALVARIANTBREAKEND.EXONPHASEUPSTREAM,
                    STRUCTURALVARIANTBREAKEND.EXONRANKDOWNSTREAM,
                    STRUCTURALVARIANTBREAKEND.EXONPHASEDOWNSTREAM,
                    STRUCTURALVARIANTBREAKEND.EXONMAX);
            for (final Transcript transcript : geneAnnotation.transcripts()) {
                inserter.values(timestamp,
                        geneAnnotation.isStart(),
                        transcript.variant().primaryKey(),
                        geneAnnotation.geneName(),
                        geneAnnotation.stableId(),
                        transcript.transcriptId(),
                        transcript.isCanonical(),
                        geneAnnotation.strand(),
                        transcript.exonUpstream(),
                        transcript.exonUpstreamPhase(),
                        transcript.exonDownstream(),
                        transcript.exonDownstreamPhase(),
                        transcript.exonMax());
            }

            final List<UInteger> ids = inserter.returning(STRUCTURALVARIANTBREAKEND.ID).fetch().getValues(0, UInteger.class);
            if (ids.size() != geneAnnotation.transcripts().size()) {
                throw new RuntimeException("not all transcripts were inserted successfully");
            }

            for (int i = 0; i < ids.size(); i++) {
                id.put(geneAnnotation.transcripts().get(i), ids.get(i).intValue());
            }
        }
    }

    // NERA: load fusions
    final InsertValuesStep3 fusionInserter = context.insertInto(STRUCTURALVARIANTFUSION,
            STRUCTURALVARIANTFUSION.ISREPORTED,
            STRUCTURALVARIANTFUSION.FIVEPRIMEBREAKENDID,
            STRUCTURALVARIANTFUSION.THREEPRIMEBREAKENDID);
    for (final GeneFusion fusion : analysis.fusions()) {
        fusionInserter.values(fusion.reportable(), id.get(fusion.upstreamLinkedAnnotation()), id.get(fusion.downstreamLinkedAnnotation()));
    }
    fusionInserter.execute();

    // NERA: load disruptions
    final InsertValuesStep2 disruptionInserter = context.insertInto(STRUCTURALVARIANTDISRUPTION,
            STRUCTURALVARIANTDISRUPTION.ISREPORTED,
            STRUCTURALVARIANTDISRUPTION.BREAKENDID);
    for (final GeneDisruption disruption : analysis.disruptions()) {
        disruptionInserter.values(disruption.reportable(), id.get(disruption.linkedAnnotation()));
    }
    disruptionInserter.execute();
}
 
開發者ID:hartwigmedical,項目名稱:hmftools,代碼行數:70,代碼來源:StructuralVariantAnnotationDAO.java


注:本文中的org.jooq.InsertValuesStep2類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。