use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class IdentifierDaoImpl method findIdentifiersByMaster.
@Override
public List<Identifier> findIdentifiersByMaster(String uniqueName) {
Map<String, Object> params = new HashMap<>();
params.put("uniqueName", uniqueName);
List<Identifier> ids = new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("identifiers-by-master-unique-name"), params, new IdentifierRowMapper(uniqueName));
return ids.stream().filter(Objects::nonNull).filter(i -> isValidIdentifier(i)).collect(Collectors.toList());
}
use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class CvJournalDaoImpl method findCvJournalsByPublicationIds.
@Override
public List<PublicationCvJournal> findCvJournalsByPublicationIds(List<Long> publicationIds) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("publicationIds", publicationIds);
return new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("cvjournal-by-publication-ids"), params, new PublicationCvJournalRowMapper());
}
use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class CvJournalDaoImpl method findById.
@Override
public CvJournal findById(Long journalId) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("journalId", journalId);
return new NamedParameterJdbcTemplate(dsLocator.getDataSource()).queryForObject(sqlDictionary.getSQLQuery("cvjournal-by-id"), params, new JournalRowMapper());
}
use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class DbXrefDaoImpl method findEntryIdentifierXrefs.
@Override
public Set<DbXref> findEntryIdentifierXrefs(String entryName) {
SqlParameterSource namedParams = new MapSqlParameterSource("uniqueName", entryName);
List<DbXref> xrefs = new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("dbxref-by-master-via-identifiers"), namedParams, new DbXRefRowMapper(entryName));
return new HashSet<>(xrefs);
}
use of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate in project nextprot-api by calipho-sib.
the class DbXrefDaoImpl method findEntryInteractionInteractantsXrefs.
@Override
public Set<DbXref> findEntryInteractionInteractantsXrefs(String entryName) {
SqlParameterSource namedParams = new MapSqlParameterSource("uniqueName", entryName);
List<DbXref> xrefs = new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("dbxref-by-master-via-interactions-interactants"), namedParams, new DbXRefRowMapper(entryName));
return new HashSet<>(xrefs);
}
Aggregations