use of org.nextprot.api.core.domain.PublicationCvJournal in project nextprot-api by calipho-sib.
the class PublicationDaoImpl method findPublicationById.
@Override
public Publication findPublicationById(long publicationId) {
SqlParameterSource namedParameters = new MapSqlParameterSource("resourceId", publicationId);
// get the journal found for publication id
List<PublicationCvJournal> journals = journalDao.findCvJournalsByPublicationIds(Collections.singletonList(publicationId));
return new NamedParameterJdbcTemplate(dsLocator.getDataSource()).queryForObject(sqlDictionary.getSQLQuery("publication-by-resourceid"), namedParameters, new PublicationRowMapper(journals));
}
use of org.nextprot.api.core.domain.PublicationCvJournal in project nextprot-api by calipho-sib.
the class PublicationDaoImpl method findSortedPublicationsByMasterId.
@Override
public List<Publication> findSortedPublicationsByMasterId(Long masterId) {
Map<String, Object> params = new HashMap<>();
params.put("identifierId", masterId);
params.put("publicationTypes", Arrays.asList(10, 20, 30, 40, 50, 60, 70, 80));
// get all journals found for all publication ids
List<PublicationCvJournal> journals = journalDao.findCvJournalsByPublicationIds(findSortedPublicationIdsByMasterId(masterId));
return new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("publication-sorted-for-master"), params, new PublicationRowMapper(journals));
}
Aggregations