Project

General

Profile

Revision 1da9046b

ID1da9046b8c9e38cff3514d6fa5e230e07f0950d2
Parent 27bed44b
Child b73f045d

Added by Patrick Plitzner over 1 year ago

ref #8011 Add termType to service method

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/common/IDefinedTermDao.java
221 221
     */
222 222
    public Collection<TermDto> getKindOfsAsDto(TermDto parentTerm);
223 223

  
224
    public Collection<TermDto> findByTitleAsDto(String title);
224
    public Collection<TermDto> findByTitleAsDto(String title, TermType termType);
225 225

  
226 226
}
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/DefinedTermDaoImpl.java
697 697
    }
698 698

  
699 699
    @Override
700
    public Collection<TermDto> findByTitleAsDto(String title) {
700
    public Collection<TermDto> findByTitleAsDto(String title, TermType termType) {
701 701
        String queryString = TermDto.getTermDtoSelect()
702
                + "where a.titleCache like :title";
702
                + " where a.titleCache like :title "
703
                + " and a.termType = :termType ";
703 704
        Query query =  getSession().createQuery(queryString);
704 705
        query.setParameter("title", "%"+title+"%");
706
        query.setParameter("termType", termType);
705 707

  
706 708
        @SuppressWarnings("unchecked")
707 709
        List<Object[]> result = query.list();
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ITermService.java
236 236
     */
237 237
    public TermDto addNewTerm(TermType termType, UUID parentUuid, boolean isKindOf);
238 238

  
239
    public Collection<TermDto> findByTitleAsDto(String title);
239
    public Collection<TermDto> findByTitleAsDto(String title, TermType termType);
240 240

  
241 241
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TermServiceImpl.java
572 572
    }
573 573

  
574 574
    @Override
575
    public Collection<TermDto> findByTitleAsDto(String title){
576
        return dao.findByTitleAsDto(title);
575
    public Collection<TermDto> findByTitleAsDto(String title, TermType termType){
576
        return dao.findByTitleAsDto(title, termType);
577 577
    }
578 578

  
579 579
    public enum TermMovePosition{

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)