use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class EntryPublicationsDaoImpl method findSortedPublicationIds.
@Override
public List<Long> findSortedPublicationIds(String entryAccession) {
Map<String, Object> params = new HashMap<>();
params.put("identifierId", masterIdentifierDao.findIdByUniqueName(entryAccession));
params.put("publicationTypes", Arrays.asList(10, 20, 30, 40, 50, 60, 70, 80));
return new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("publication-sorted-for-master"), params, new JdbcUtils.LongRowMapper("resource_id"));
}
use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class GeneDAOImpl method findTranscriptMappingsByIsoformName.
@Override
public Map<String, List<TranscriptGeneMapping>> findTranscriptMappingsByIsoformName(Collection<String> isoformNames) {
SqlParameterSource namedParameters = new MapSqlParameterSource("isoform_names", isoformNames);
List<TranscriptGeneMapping> list = new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("transcripts-by-isoform-names"), namedParameters, new TranscriptRowMapper());
return list.stream().collect(Collectors.groupingBy(TranscriptGeneMapping::getIsoformName, Collectors.toList()));
}
use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class GeneDAOImpl method findExonsAlignedToTranscriptOfGene.
@Override
public List<UncategorizedExon> findExonsAlignedToTranscriptOfGene(String transcriptName, String geneName) {
MapSqlParameterSource namedParameters = new MapSqlParameterSource("transcriptName", transcriptName);
namedParameters.addValue("geneName", geneName);
return new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("exons-aligned-to-transcript"), namedParameters, new ExonMapper());
}
use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class InteractionDaoImpl method findInteractionsByEntry.
@Override
public List<Interaction> findInteractionsByEntry(String entryName) {
String sql = sqlDictionary.getSQLQuery("interactions_by_entry");
SqlParameterSource namedParameters = new MapSqlParameterSource("entryName", entryName);
return new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sql, namedParameters, new InteractionRowMapper());
}
use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class AntibodyMappingDaoImpl method findAntibodyMappingAnnotationsById.
@Override
public List<Annotation> findAntibodyMappingAnnotationsById(long masterId) {
SqlParameterSource namedParams = new MapSqlParameterSource("id", masterId);
AntibodyRowMapper rowMapper = new AntibodyRowMapper();
new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("antibodies-by-id"), namedParams, rowMapper);
return rowMapper.getAnnotations();
}
Aggregations