Opened 16 years ago

Closed 16 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:


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.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: 
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 Changed 16 years ago by Nicklas Nordborg

Status: newassigned

comment:2 Changed 16 years ago by Nicklas Nordborg

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.