org.intermine.api.bag
Class BagQueryRunner

java.lang.Object
  extended by org.intermine.api.bag.BagQueryRunner

public class BagQueryRunner
extends java.lang.Object

For a given list of input strings search for objects using default and configured queries for a particular type.


Constructor Summary
BagQueryRunner(ObjectStore os, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys, BagQueryConfig bagQueryConfig, java.util.List<TemplateQuery> conversionTemplates)
          Construct with configured bag queries and a map of type -> key fields.
 
Method Summary
 BagQueryResult searchForBag(java.lang.String type, java.util.List<java.lang.String> input, java.lang.String extraFieldValue, boolean doWildcards)
          Given an input list of string identifiers search for corresponding objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BagQueryRunner

public BagQueryRunner(ObjectStore os,
                      java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys,
                      BagQueryConfig bagQueryConfig,
                      java.util.List<TemplateQuery> conversionTemplates)
Construct with configured bag queries and a map of type -> key fields.

Parameters:
os - the ObjectStore to run queries on
classKeys - the class keys Map
bagQueryConfig - the configuration for running queries
conversionTemplates - a list of template queries to be used when type converting results
Method Detail

searchForBag

public BagQueryResult searchForBag(java.lang.String type,
                                   java.util.List<java.lang.String> input,
                                   java.lang.String extraFieldValue,
                                   boolean doWildcards)
                            throws java.lang.ClassNotFoundException,
                                   InterMineException
Given an input list of string identifiers search for corresponding objects. First run a default query then any queries configured for the specified type.

Parameters:
type - an unqualified class name to search for objects
input - a list of strings to query
extraFieldValue - the value used when adding an extra constraint to the bag query, configured in BagQueryConfig (e.g. if connectField is "organism", the extraClassName is "Organism" and the constrainField is "name", the extraFieldValue might be "Drosophila melanogaster")
doWildcards - true if the strings should be evaluated as wildcards
Returns:
the matches, issues and unresolved input
Throws:
java.lang.ClassNotFoundException - if the type isn't in the model
InterMineException - if there is any other exception