Opened 12 years ago

Closed 12 years ago

#1671 closed defect (fixed)

Can't filter on annotation equal to a specific value for a joined item

Reported by: Nicklas Nordborg Owned by: everyone
Priority: minor Milestone: BASE 3.1
Component: core Version:
Keywords: Cc:

Description

Create a query with a filter on an annotation for a joined item. For example:

  • Create a query that load the wells on a bioplate: query = BioPlate.getBioWells();
  • Join the biomaterial items: query.join(Hql.innerJoin("bioMaterial", "bm"));
  • Filter on an annotation on the biomaterial: query.restrict(Annotations.eq("bm", qcHiSenseType, true, false));

The result is a HQL error:

Error: could not resolve property: annotationSet of: net.sf.basedb.core.data.BioWellData 
[SELECT bwl FROM net.sf.basedb.core.data.BioWellData bwl 
INNER JOIN bwl.bioMaterial bm 
WHERE (bwl.bioPlate = :bioPlate) 
AND (bwl.annotationSet IN (0)) 
ORDER BY bwl.row ASC, bwl.column ASC]

The annotation is incorrectly used with the biowell (bwl.annotationSet) instead of the biomaterial (bm.annotationSet).

Change History (1)

comment:1 by Nicklas Nordborg, 12 years ago

Resolution: fixed
Status: newclosed

(In [6017]) Fixes #1671: Can't filter on annotation equal to a specific value for a joined item

Note: See TracTickets for help on using tickets.