use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class DbXrefDaoImpl method findDbXRefsByPublicationId.
@Override
public List<PublicationDbXref> findDbXRefsByPublicationId(Long publicationId) {
Map<String, Object> params = new HashMap<>();
params.put("publicationId", publicationId);
return new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("dbxref-publication-by-id"), params, new PublicationDbXRefRowMapper());
}
use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class SchemaDaoImpl method findAllSource.
@Override
public List<OWLDatasource> findAllSource() {
SqlParameterSource params = new MapSqlParameterSource();
List<OWLDatasource> datasources = new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("schema-datasource-list"), params, new ParameterizedRowMapper<OWLDatasource>() {
@Override
public OWLDatasource mapRow(ResultSet resultSet, int row) throws SQLException {
OWLDatasource datasource = new OWLDatasource();
datasource.setName(resultSet.getString("name"));
datasource.setDescription(resultSet.getString("description"));
datasource.setURL(resultSet.getString("url"));
return datasource;
}
});
return datasources;
}
use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class SchemaDaoImpl method findAllDatabase.
@Override
public List<OWLDatabase> findAllDatabase() {
SqlParameterSource params = new MapSqlParameterSource();
List<OWLDatabase> databases = new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("schema-database-list"), params, new ParameterizedRowMapper<OWLDatabase>() {
@Override
public OWLDatabase mapRow(ResultSet resultSet, int row) throws SQLException {
OWLDatabase database = new OWLDatabase();
database.setName(resultSet.getString("name"));
database.setDescription(resultSet.getString("description"));
database.setURL(resultSet.getString("url"));
database.setCategory(resultSet.getString("category"));
return database;
}
});
return databases;
}
use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class SchemaDaoImpl method findAllProvenance.
/**
* same as findAllDatabase() union identifier type names as pseudo database name
*/
@Override
public List<OWLDatabase> findAllProvenance() {
SqlParameterSource params = new MapSqlParameterSource();
List<OWLDatabase> databases = new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("schema-provenance-list"), params, new ParameterizedRowMapper<OWLDatabase>() {
@Override
public OWLDatabase mapRow(ResultSet resultSet, int row) throws SQLException {
OWLDatabase database = new OWLDatabase();
database.setName(resultSet.getString("name"));
database.setDescription(resultSet.getString("description"));
database.setURL(resultSet.getString("url"));
database.setCategory(resultSet.getString("category"));
return database;
}
});
return databases;
}
use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 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;
}
Aggregations