Project

General

Profile

« Previous | Next » 

Revision 73addc03

Added by Patrick Plitzner about 5 years ago

ref #8011 Allow null for termType to ignore this filter

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/DefinedTermDaoImpl.java
700 700
    public Collection<TermDto> findByTitleAsDto(String title, TermType termType) {
701 701
        String queryString = TermDto.getTermDtoSelect()
702 702
                + " where a.titleCache like :title "
703
                + " and a.termType = :termType ";
703
                + (termType!=null?" and a.termType = :termType ":"");
704 704
        Query query =  getSession().createQuery(queryString);
705 705
        query.setParameter("title", "%"+title+"%");
706
        query.setParameter("termType", termType);
706
        if(termType!=null){
707
            query.setParameter("termType", termType);
708
        }
707 709

  
708 710
        @SuppressWarnings("unchecked")
709 711
        List<Object[]> result = query.list();

Also available in: Unified diff