Opened 10 years ago

Closed 10 years ago

#1934 closed defect (fixed)

Filtering on multi-valued annotation with 'null' and one other values gives error

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

Description

  1. Create a string annotation type for samples (or any other item) and set multiplicity to '0'.
  2. Go to the list page and configure it so that the annotation type is visible.
  3. Add a filter with one value and null (eg. =foo|)

An error message is displayed and the filter is ignored:

Could not filter on 'Sample.#754592': null

The log file has a stack trace with more information:

09:43:44,221  WARN Application:1358 - Could not filter on 'Sample.#754592'
java.lang.NullPointerException
  at net.sf.basedb.core.AnnotationSimpleRestriction.<init>(AnnotationSimpleRestriction.java:163)
  at net.sf.basedb.core.PropertyFilter.getRestriction(PropertyFilter.java:557)
  at net.sf.basedb.core.ItemContext.configureQuery(ItemContext.java:1330)
  at net.sf.basedb.clients.web.Base.getConfiguredQuery(Base.java:953)
  at org.apache.jsp.biomaterials.samples.list_005fsamples_jsp._jspService(list_005fsamples_jsp.java:367)
...

Change History (1)

comment:1 by Nicklas Nordborg, 10 years ago

Resolution: fixed
Status: newclosed

(In [6832]) Fixes #1934: Filtering on multi-valued annotation with 'null' and one other values gives error

This also fixes the problem with null searches for annotations as outlined in #1205. Though, in this case it was not really related to three-valued logic used in SQL. Null searches on annotations require different queries than what is used to find specific values and the result is OR-ed together.

Note: See TracTickets for help on using tickets.