<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edacc.model;

import edacc.properties.PropertyTypeNotExistException;
import java.io.IOException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Vector;

/**
 * Implements the data access object of the ExperimentResultHasProperty class
 * @author rretz
 */
public class ExperimentResultHasPropertyDAO {

    protected static final String table = "ExperimentResult_has_Property";
    protected static final String valueTable = "ExperimentResult_has_PropertyValue";
    private static final ObjectCache<ExperimentResultHasProperty> cache = new ObjectCache<ExperimentResultHasProperty>();
    private static final String deleteQuery = "DELETE FROM " + table + " WHERE idExperimentResult_has_Property=?";
    private static String updateQuery = "UPDATE " + table + " SET idExperimentResults=?, idProperty=? WHERE idExperimentResult_has_Property=?";
    private static String insertQuery = "INSERT INTO " + table + " (idExperimentResults, idProperty) VALUES (?, ?)";
    private static final String deleteValueQuery = "DELETE FROM " + valueTable + " WHERE id=?";
    private static String insertValueQuery = "INSERT INTO " + valueTable + " (idExperimentResult_has_Property, value, EDACC5.ExperimentResult_has_PropertyValue.order) VALUES (?, ?, ?)";

    /**
     * Creates a new  ExperimentResultHasProperty object, saves it into the database and cache, and returns it.
     * @param expResult related ExperimentResult object
     * @param solvProperty related Property object
     * @return new ExperimentResultHasProperty which is also deposited in the database.
     * @throws NoConnectionToDBException
     * @throws SQLException
     */
    public static ExperimentResultHasProperty createExperimentResultHasPropertyDAO(ExperimentResult expResult, Property solvProperty)
            throws NoConnectionToDBException, SQLException {
        ExperimentResultHasProperty e = new ExperimentResultHasProperty();
        e.setExpResId(expResult.getId());
        e.setPropId(solvProperty.getId());
        e.setExpResult(expResult);
        e.setSolvProperty(solvProperty);
        e.setValue(null);
        e.setNew();
        save(e);
        return e;<commit_msg>fixed ExperimentResultHasPropertyDAO<commit_after>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edacc.model;

import edacc.properties.PropertyTypeNotExistException;
import java.io.IOException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Vector;

/**
 * Implements the data access object of the ExperimentResultHasProperty class
 * @author rretz
 */
public class ExperimentResultHasPropertyDAO {

    protected static final String table = "ExperimentResult_has_Property";
    protected static final String valueTable = "ExperimentResult_has_PropertyValue";
    private static final ObjectCache<ExperimentResultHasProperty> cache = new ObjectCache<ExperimentResultHasProperty>();
    private static final String deleteQuery = "DELETE FROM " + table + " WHERE idExperimentResult_has_Property=?";
    private static String updateQuery = "UPDATE " + table + " SET idExperimentResults=?, idProperty=? WHERE idExperimentResult_has_Property=?";
    private static String insertQuery = "INSERT INTO " + table + " (idExperimentResults, idProperty) VALUES (?, ?)";
    private static final String deleteValueQuery = "DELETE FROM " + valueTable + " WHERE id=?";
    private static String insertValueQuery = "INSERT INTO " + valueTable + " (idExperimentResult_has_Property, value, `order`) VALUES (?, ?, ?)";

    /**
     * Creates a new  ExperimentResultHasProperty object, saves it into the database and cache, and returns it.
     * @param expResult related ExperimentResult object
     * @param solvProperty related Property object
     * @return new ExperimentResultHasProperty which is also deposited in the database.
     * @throws NoConnectionToDBException
     * @throws SQLException
     */
    public static ExperimentResultHasProperty createExperimentResultHasPropertyDAO(ExperimentResult expResult, Property solvProperty)
            throws NoConnectionToDBException, SQLException {
        ExperimentResultHasProperty e = new ExperimentResultHasProperty();
        e.setExpResId(expResult.getId());
        e.setPropId(solvProperty.getId());
        e.setExpResult(expResult);
        e.setSolvProperty(solvProperty);
        e.setValue(null);
        e.setNew();
        save(e);
        return e;
{'fraction_non_alphanumeric': 0.08286252354048965, 'fraction_numerical': 0.0002092487968194183, 'mean_word_length': 4.469107551487414, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4037915', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1223, 'n_words': 360}