<commit_before>package org.mskcc.cbio.cgds.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
import java.util.regex.*;
import org.apache.commons.lang.StringUtils;
import org.mskcc.cbio.cgds.model.Case;
import org.mskcc.cbio.cgds.model.CosmicMutationFrequency;
import org.mskcc.cbio.cgds.model.ExtendedMutation;

/**
 * Data access object for mutation_event and case_mutation_event tables
 */
public final class DaoMutationEvent {

    /**
     * Private Constructor (Singleton pattern).
     */
    private DaoMutationEvent() {
    }

    public static int addMutation(ExtendedMutation mutation) throws DaoException {
        Connection con = null;
        PreparedStatement pstmt = null;
        ResultSet rs = null;
        try {
            con = JdbcUtil.getDbConnection();
            long eventId = addMutationEvent(mutation, con);
            
            if (eventExists(eventId, mutation.getCaseId(), mutation.getGeneticProfileId(), con)) {
                return 0;
            }
            
            pstmt = con.prepareStatement
		("INSERT INTO case_mutation_event (`MUTATION_EVENT_ID`, `CASE_ID`, `GENETIC_PROFILE_ID`, "
                    + "`VALIDATION_STATUS`, `TUMOR_ALT_COUNT`, `TUMOR_REF_COUNT`, `NORMAL_ALT_COUNT`, `NORMAL_REF_COUNT`) VALUES(?,?,?,?)");
            pstmt.setLong(1, eventId);
            pstmt.setString(2, mutation.getCaseId());
            pstmt.setInt(3, mutation.getGeneticProfileId());<commit_msg>fixed bug in DaoMutationEvent sql<commit_after>package org.mskcc.cbio.cgds.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
import java.util.regex.*;
import org.apache.commons.lang.StringUtils;
import org.mskcc.cbio.cgds.model.Case;
import org.mskcc.cbio.cgds.model.CosmicMutationFrequency;
import org.mskcc.cbio.cgds.model.ExtendedMutation;

/**
 * Data access object for mutation_event and case_mutation_event tables
 */
public final class DaoMutationEvent {

    /**
     * Private Constructor (Singleton pattern).
     */
    private DaoMutationEvent() {
    }

    public static int addMutation(ExtendedMutation mutation) throws DaoException {
        Connection con = null;
        PreparedStatement pstmt = null;
        ResultSet rs = null;
        try {
            con = JdbcUtil.getDbConnection();
            long eventId = addMutationEvent(mutation, con);
            
            if (eventExists(eventId, mutation.getCaseId(), mutation.getGeneticProfileId(), con)) {
                return 0;
            }
            
            pstmt = con.prepareStatement
		("INSERT INTO case_mutation_event (`MUTATION_EVENT_ID`, `CASE_ID`, `GENETIC_PROFILE_ID`, "
                    + "`VALIDATION_STATUS`, `TUMOR_ALT_COUNT`, `TUMOR_REF_COUNT`, `NORMAL_ALT_COUNT`, `NORMAL_REF_COUNT`) VALUES(?,?,?,?,?,?,?,?)");
            pstmt.setLong(1, eventId);
            pstmt.setString(2, mutation.getCaseId());
            pstmt.setInt(3, mutation.getGeneticProfileId());
{'fraction_non_alphanumeric': 0.11397295556986478, 'fraction_numerical': 0.0025756600128783, 'mean_word_length': 3.019404915912031, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7487045', 'n_tokens_mistral': 985, 'n_tokens_neox': 946, 'n_words': 183}