Project

General

Profile

bug #8287

RegistrationServiceImpl.page( .... Collection<UUID> typeDesignationStatusUuids ... ) fails when NULL and UUIDs are passed

Added by Andreas Kohlbecker 7 months ago. Updated 5 months ago.

Status:
Closed
Priority:
New
Category:
cdmlib
Target version:
Start date:
05/20/2019
Due date:
% Done:

100%

Severity:
normal
Found in Version:
Tags:

Description

In case the collection of typeDesignationStatusUuids contains both, a null value and UUIDs the request fails.

This is caused by a bug in CdmEntityDaoBase.addRestrictions(List<Restriction<?>> restrictions, DetachedCriteria criteria) where the implementation fails to distinguish aliases for different JOIN methods. This causes the method to attempt create the same alias name two times, which finally result in:

org.hibernate.QueryException: duplicate alias: typeDesignations
    at org.hibernate.loader.criteria.CriteriaQueryTranslator.createAliasCriteriaMap(CriteriaQueryTranslator.java:141)
    at org.hibernate.loader.criteria.CriteriaQueryTranslator.<init>(CriteriaQueryTranslator.java:92)
    at org.hibernate.loader.criteria.CriteriaQueryTranslator.<init>(CriteriaQueryTranslator.java:78)
    at org.hibernate.criterion.SubqueryExpression.createAndSetInnerQuery(SubqueryExpression.java:129)
    at org.hibernate.criterion.SubqueryExpression.toSqlString(SubqueryExpression.java:61)
    at org.hibernate.loader.criteria.CriteriaQueryTranslator.getWhereCondition(CriteriaQueryTranslator.java:400)
    at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:95)
    at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:75)
    at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:80)
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1760)
    at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:363)
    at org.hibernate.internal.CriteriaImpl.uniqueResult(CriteriaImpl.java:385)
    at eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase.count(CdmEntityDaoBase.java:691)
    at eu.etaxonomy.cdm.api.service.RegistrationServiceImpl.page(RegistrationServiceImpl.java:183)

This problem would actually not become relevant if the the RegistrationServiceImpl.page( .... Collection<UUID> typeDesignationStatusUuids ... ) could be implemented so that the Restriction for typeDesignationStatus=NULL OR typeDesignationStatus.uuis IN (...) would be enclosed in "brackets", which currently is not yet possible with the cdm-Restrictions.

Regarding the page method it would be best to implement a dedicated dao method with tests instead of using the generic list methods with Restriction parameters.

TODO:

  1. implement dedicated dao method #8330
  2. re-enable search form multiselect, see cdm-dataportal|a0d2a22c

Related issues

Related to Edit - feature request #8330: RegistrationDao search method Closed 06/06/2019
Copied from Edit - feature request #7966: Registration search simplify type select options Closed 12/20/2018

Associated revisions

Revision a0d2a22c (diff)
Added by Andreas Kohlbecker 7 months ago

ref #8287 comment to re-enable multi selection of options once the web service bug is fixed

Revision c40f420c (diff)
Added by Andreas Kohlbecker 5 months ago

fix #8287 implementing support for null type status as filter value in Registration service

Revision 88131480 (diff)
Added by Andreas Kohlbecker 5 months ago

ref #8287 re-enabling type status filter multiple options

History

#1 Updated by Andreas Kohlbecker 7 months ago

#2 Updated by Andreas Kohlbecker 7 months ago

  • Description updated (diff)

#3 Updated by Andreas Kohlbecker 6 months ago

#4 Updated by Andreas Kohlbecker 6 months ago

  • Description updated (diff)

#5 Updated by Andreas Kohlbecker 6 months ago

  • Status changed from New to In Progress

#6 Updated by Andreas Kohlbecker 5 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 50

#7 Updated by Andreas Kohlbecker 5 months ago

  • Assignee changed from Andreas Kohlbecker to Wolf-Henning Kusber

please review

#8 Updated by Andreas Kohlbecker 5 months ago

  • Target version changed from Release 5.10 to Release 5.8

#9 Updated by Wolf-Henning Kusber 5 months ago

  • Assignee changed from Wolf-Henning Kusber to Andreas Kohlbecker
  • % Done changed from 50 to 100

combination of types and none are searchable without errors in Vaadin and the portal. If this is the feedback for this ticket, it can be closed.

#10 Updated by Andreas Kohlbecker 5 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)