Project

General

Profile

Actions

bug #8287

closed

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

Added by Andreas Kohlbecker over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
New
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
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 ClosedAndreas Kohlbecker

Actions
Copied from EDIT - feature request #7966: Registration search simplify type select optionsClosedAndreas Kohlbecker

Actions
Actions #1

Updated by Andreas Kohlbecker over 5 years ago

Actions #2

Updated by Andreas Kohlbecker over 5 years ago

  • Description updated (diff)
Actions #3

Updated by Andreas Kohlbecker about 5 years ago

Actions #4

Updated by Andreas Kohlbecker about 5 years ago

  • Description updated (diff)
Actions #5

Updated by Andreas Kohlbecker about 5 years ago

  • Status changed from New to In Progress
Actions #6

Updated by Andreas Kohlbecker about 5 years ago

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

Updated by Andreas Kohlbecker about 5 years ago

  • Assignee changed from Andreas Kohlbecker to Wolf-Henning Kusber

please review

Actions #8

Updated by Andreas Kohlbecker about 5 years ago

  • Target version changed from Release 5.10 to Release 5.8
Actions #9

Updated by Wolf-Henning Kusber about 5 years 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.

Actions #10

Updated by Andreas Kohlbecker about 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF