Search in sources :

Example 1 with Identifier

use of org.nextprot.api.core.domain.Identifier 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());
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) ParameterizedRowMapper(org.springframework.jdbc.core.simple.ParameterizedRowMapper) NamedParameterJdbcTemplate(org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate) Autowired(org.springframework.beans.factory.annotation.Autowired) DbXrefURLResolverDelegate(org.nextprot.api.core.service.dbxref.resolver.DbXrefURLResolverDelegate) HashMap(java.util.HashMap) Identifier(org.nextprot.api.core.domain.Identifier) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) SQLException(java.sql.SQLException) List(java.util.List) SQLDictionary(org.nextprot.api.commons.utils.SQLDictionary) ResultSet(java.sql.ResultSet) IdentifierDao(org.nextprot.api.core.dao.IdentifierDao) Map(java.util.Map) DataSourceServiceLocator(org.nextprot.api.commons.spring.jdbc.DataSourceServiceLocator) Repository(org.springframework.stereotype.Repository) Identifier(org.nextprot.api.core.domain.Identifier) HashMap(java.util.HashMap) NamedParameterJdbcTemplate(org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate) Objects(java.util.Objects)

Aggregations

ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Objects (java.util.Objects)1 Collectors (java.util.stream.Collectors)1 DataSourceServiceLocator (org.nextprot.api.commons.spring.jdbc.DataSourceServiceLocator)1 SQLDictionary (org.nextprot.api.commons.utils.SQLDictionary)1 IdentifierDao (org.nextprot.api.core.dao.IdentifierDao)1 DbXref (org.nextprot.api.core.domain.DbXref)1 Identifier (org.nextprot.api.core.domain.Identifier)1 DbXrefURLResolverDelegate (org.nextprot.api.core.service.dbxref.resolver.DbXrefURLResolverDelegate)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 NamedParameterJdbcTemplate (org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate)1 ParameterizedRowMapper (org.springframework.jdbc.core.simple.ParameterizedRowMapper)1 Repository (org.springframework.stereotype.Repository)1