Revision 6f295b88
Added by Katja Luther over 6 years ago
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
ref #7121: when no vocabulary is chosen, all vocabularies are searched in NamedAreaSelection