Opened 17 years ago

Closed 17 years ago

#672 closed enhancement (fixed)

Enable AnnotationRestriction to be used on joined tables

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 2.4
Component: core Version:
Keywords: Cc:

Description

For example, the query below gives a stracktrace, since annotations can only be used on the root entity.

ItemQuery<Experiment> expt_query = Experiment.getQuery();
expt_query.include(Include.SHARED);
expt_query.setDistinct(true);
expt_query.join(Hql.innerJoin("bioAssaySets", Item.BIOASSAYSET.getAlias()));
expt_query.restrict(Annotations.eq(final_bas_annotation_type, true, false));

The error message is:

[java] net.sf.basedb.core.BaseException: could not resolve property: 
annotationSet of: net.sf.basedb.core.data.ExperimentData 
[SELECT DISTINCT xpr FROM net.sf.basedb.core.data.ExperimentData xpr 
INNER JOIN xpr.bioAssaySets bas 
WHERE xpr.annotationSet IN (0,308,310,314)]

The solution is to duplicate all methods in the Annotations class and add an 'alias' parameter to the new methods.

Change History (2)

comment:1 by Nicklas Nordborg, 17 years ago

Status: newassigned

comment:2 by Nicklas Nordborg, 17 years ago

Resolution: fixed
Status: assignedclosed

(In [3561]) Fixes #672: Enable AnnotationRestriction to be used on joined tables

Note: See TracTickets for help on using tickets.