Project

General

Profile

bug #9457

Distribution editor: Taxon filter broken due to invalid HQL in TaxonNodeServiceImpl.getUuidAndTitleCache()

Added by Andreas Kohlbecker 28 days ago. Updated 26 days ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib
Target version:
Start date:
02/08/2021
Due date:
% Done:

100%

Severity:
normal
Found in Version:

Description

to reproduce:

10:25:27.241 [flora-cuba] [qtp527446182-11880] ERROR c.vaadin.server.DefaultErrorHandler -
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: cls near line 1, column 367 [SELECT new eu.etaxonomy.cdm.persistence.dto.SortableTaxon
NodeQueryResult( tn.uuid, tn.id, t.titleCache, rank )  FROM eu.etaxonomy.cdm.model.taxon.TaxonNode tn    INNER JOIN tn.taxon AS t    INNER JOIN tn.classifica
tion AS cls    INNER JOIN t.name AS name    LEFT OUTER JOIN name.rank AS rank WHERE t.titleCache LIKE :pattern OR t.titleCache LIKE :doubtfulPatternAND cls.u
uid = :classificationUuid]
        at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:74)
        at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:91)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:287)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:186)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:141)
        at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115)
        at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:76)
        at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:150)
        at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:302)
        at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:240)
        at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1907)
        at eu.etaxonomy.cdm.persistence.dao.hibernate.taxon.TaxonNodeDaoHibernateImpl.getUuidAndTitleCache(TaxonNodeDaoHibernateImpl.java:222)
        at eu.etaxonomy.cdm.api.service.TaxonNodeServiceImpl.getUuidAndTitleCache(TaxonNodeServiceImpl.java:196)

Related issues

Related to Edit - bug #9461: Filter in vaadin distribution editor does not work Resolved 02/09/2021
Duplicated by Edit - bug #7254: Filter in vaadin distribution editor throws exception Worksforme 02/12/2018

Associated revisions

Revision e0e956a8 (diff)
Added by Andreas Müller 28 days ago

fix #9457 fix missing space in HQL

Revision 1606ebde (diff)
Added by Andreas Müller 28 days ago

ref #9457 fix missing space in HQL (cont.)

Revision e6d5c3e2 (diff)
Added by Andreas Müller 27 days ago

ref #9457 , ref #9461 fix incorrect handling of AND/OR logic in doubtfulPattern handling in TaxonNodeDaoHibernateImpl.getUuidAndTitleCache

Revision 15647253 (diff)
Added by Katja Luther 24 days ago

add test for uuidAndTitleCache in TaxonNodedao and code cleau

History

#1 Updated by Andreas Müller 28 days ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#2 Updated by Andreas Kohlbecker 28 days ago

  • Duplicated by bug #7254: Filter in vaadin distribution editor throws exception added

#3 Updated by Andreas Müller 28 days ago

  • Assignee changed from Andreas Müller to Andreas Kohlbecker
  • Target version changed from cdmlib - Old Next Major Release to Release 5.20

Can you please review. I only fixed in theory, did not test.

#4 Updated by Andreas Müller 28 days ago

By the way, please do not use the "cdmlib - Next Major Release" anymore. It is deprecated and will be closed soon, after tickets were moved to other milestones. Milestones to use for cdmlib tickets are "unassigned", "Reviewed next major" and current milestones.

#5 Updated by Andreas Kohlbecker 27 days ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Kohlbecker to Andreas Müller

I aimed in testing the fix in the vaadin distribution editor itself ... the exception no longer occurs but no taxon records are returned at all. So I can't say if the commit really makes the service method functional again if only the exception is prevented.

I suggest that the method should be covered by tests if not yet done so far.

#6 Updated by Andreas Müller 27 days ago

  • Related to bug #9461: Filter in vaadin distribution editor does not work added

#7 Updated by Andreas Müller 26 days ago

  • Status changed from Feedback to Closed
  • % Done changed from 50 to 100

I created a new ticket for the non-working filter: #9461 . So I think we can close this ticket.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)