Project

General

Profile

Revision 7258c318

ID7258c318491428059a6ac845cb2813baee7c987a
Parent 95f65f5e
Child be0e5d61

Added by Katja Luther about 4 years ago

fix #5837: search on abbrevTitleCache instead of abbrev title

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/reference/ReferenceDaoHibernateImpl.java
270 270

  
271 271
        Query query = null;
272 272
        if (pattern != null){
273
            query = session.createQuery("select uuid, id, abbrevTitle, titleCache from " + type.getSimpleName() +" where (abbrevTitle like :pattern OR (abbrevTitle IS NULL AND titleCache like :pattern)) ");
273
            query = session.createQuery("select uuid, id, abbrevTitleCache, titleCache from " + type.getSimpleName() +" where abbrevTitleCache like :pattern  ");
274 274
            pattern = pattern + "%";
275 275
            pattern = pattern.replace("*", "%");
276 276
            pattern = pattern.replace("?", "_");
277 277
            query.setParameter("pattern", pattern);
278 278
        } else {
279
            query = session.createQuery("select uuid, id, abbrevTitle, titleCache from " + type.getSimpleName() );
279
            query = session.createQuery("select uuid, id, abbrevTitleCache, titleCache from " + type.getSimpleName() );
280 280
        }
281 281
        if (limit != null){
282 282
           query.setMaxResults(limit);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)