Search in sources :

Example 1 with OWLEvidence

use of org.nextprot.api.rdf.domain.OWLEvidence in project nextprot-api by calipho-sib.

the class SchemaDaoImpl method findAllEvidence.

@Override
public List<OWLEvidence> findAllEvidence() {
    SqlParameterSource params = new MapSqlParameterSource();
    List<OWLEvidence> evidences = new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("schema-evidence-list"), params, new ParameterizedRowMapper<OWLEvidence>() {

        @Override
        public OWLEvidence mapRow(ResultSet resultSet, int row) throws SQLException {
            OWLEvidence evidence = new OWLEvidence();
            evidence.setType(resultSet.getString("type"));
            evidence.setDescription(resultSet.getString("description"));
            evidence.setCount(resultSet.getInt("n"));
            return evidence;
        }
    });
    return evidences;
}
Also used : MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource) SqlParameterSource(org.springframework.jdbc.core.namedparam.SqlParameterSource) MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource) NamedParameterJdbcTemplate(org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate) SQLException(java.sql.SQLException) ResultSet(java.sql.ResultSet) OWLEvidence(org.nextprot.api.rdf.domain.OWLEvidence)

Aggregations

ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 OWLEvidence (org.nextprot.api.rdf.domain.OWLEvidence)1 MapSqlParameterSource (org.springframework.jdbc.core.namedparam.MapSqlParameterSource)1 NamedParameterJdbcTemplate (org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate)1 SqlParameterSource (org.springframework.jdbc.core.namedparam.SqlParameterSource)1