Project

General

Profile

Revision 6f295b88

ID6f295b881ec2a5de4e190bf7cc6ee419d946b107
Parent 7e898982
Child 5d7695c4

Added by Katja Luther almost 4 years ago

ref #7121: when no vocabulary is chosen, all vocabularies are searched in NamedAreaSelection

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/DefinedTermDaoImpl.java
717 717
        Session session = getSession();
718 718
        Query query = null;
719 719
        if (pattern != null){
720
            query = session.createQuery("from NamedArea where titleCache like :pattern and vocabulary in :vocs");
720
            if (vocs != null & !vocs.isEmpty()){
721
                query = session.createQuery("from NamedArea where titleCache like :pattern and vocabulary in :vocs");
722
                query.setParameterList("vocs", vocs);
723
            }else{
724
                query = session.createQuery("from NamedArea where titleCache like :pattern ");
725
            }
721 726
            pattern = pattern.replace("*", "%");
722 727
            pattern = pattern.replace("?", "_");
723 728
            pattern = pattern + "%";
724 729
            query.setParameter("pattern", pattern);
725
            query.setParameterList("vocs", vocs);
730

  
726 731
        } else {
727 732
            query = session.createQuery("from NamedArea where vocabulary in :vocs");
728 733
            query.setParameterList("vocs", vocs);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)