Search in sources :

Example 1 with AlignementPreferences

use of mom.trd.opentheso.core.alignment.AlignementPreferences in project opentheso by miledrousset.

the class GpsBeans method getPreferenceAlignement.

/**
 * Recuperation des preferences pour alignement
 *
 * @param idTheso
 * @param id_user
 */
public void getPreferenceAlignement(String idTheso, int id_user) {
    alignementPreferencesAlignement = new AlignementPreferences();
    AlignmentHelper alignmentHelper = new AlignmentHelper();
    alignementPreferencesAlignement = alignmentHelper.getListPreferencesAlignement(connect.getPoolConnexion(), idTheso, id_user, id_concept_depart, nodePreference.getId_alignement_source());
}
Also used : AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) AlignementPreferences(mom.trd.opentheso.core.alignment.AlignementPreferences)

Example 2 with AlignementPreferences

use of mom.trd.opentheso.core.alignment.AlignementPreferences in project opentheso by miledrousset.

the class AlignmentHelper method getListPreferencesAlignement.

public AlignementPreferences getListPreferencesAlignement(HikariDataSource ds, String id_theso, int id_user, String id_concept_depart, int id_alignement_source) {
    AlignementPreferences alignementPreferences = new AlignementPreferences();
    Statement stmt;
    Connection conn;
    ResultSet rs;
    try {
        // Get connection from pool
        conn = ds.getConnection();
        try {
            stmt = conn.createStatement();
            try {
                stmt = conn.createStatement();
                String query = "select * from alignement_preferences where id_thesaurus = '" + id_theso + "' and id_user = " + id_user + " and id_concept_depart ='" + id_concept_depart + "'" + " and  id_alignement_source=" + id_alignement_source;
                rs = stmt.executeQuery(query);
                if (rs.next()) {
                    alignementPreferences.setId_concetp_depart(rs.getString("id_concept_depart"));
                    alignementPreferences.setId_concept_tratees(rs.getString("id_concept_tratees"));
                }
            } finally {
                stmt.close();
            }
        } finally {
            conn.close();
        }
    } catch (SQLException sqle) {
        // Log exception
        log.error("Error while get alignement's preferences", sqle);
    }
    return alignementPreferences;
}
Also used : SQLException(java.sql.SQLException) Statement(java.sql.Statement) Connection(java.sql.Connection) ResultSet(java.sql.ResultSet) AlignementPreferences(mom.trd.opentheso.core.alignment.AlignementPreferences)

Example 3 with AlignementPreferences

use of mom.trd.opentheso.core.alignment.AlignementPreferences in project opentheso by miledrousset.

the class AlignementParLotBean method getPreferenceAlignement.

// private ArrayList<String> remiseSuite() {
// }
/**
 * Recuperation des preferences pour alignement
 *
 * @param idTheso
 * @param id_user
 */
public void getPreferenceAlignement(String idTheso, int id_user) {
    alignementPreferences = new AlignementPreferences();
    AlignmentHelper alignmentHelper = new AlignmentHelper();
    alignementPreferences = alignmentHelper.getListPreferencesAlignement(connect.getPoolConnexion(), idTheso, id_user, id_concept_depart, selectedTerme.alignementSource.getId());
}
Also used : AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) AlignementPreferences(mom.trd.opentheso.core.alignment.AlignementPreferences)

Aggregations

AlignementPreferences (mom.trd.opentheso.core.alignment.AlignementPreferences)3 AlignmentHelper (mom.trd.opentheso.bdd.helper.AlignmentHelper)2 Connection (java.sql.Connection)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Statement (java.sql.Statement)1