Package org.intermine.api.query
Class PathQueryExecutor
- java.lang.Object
-
- org.intermine.api.query.QueryExecutor
-
- org.intermine.api.query.PathQueryExecutor
-
public class PathQueryExecutor extends QueryExecutor
Executes path query and returns results in form suitable for export or web services.- Author:
- Jakub Kulaviak, Alex Kalderimis
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_BATCH_SIZE
default batch size-
Fields inherited from class org.intermine.api.query.QueryExecutor
bagManager, bagQueryRunner, os, profile, queryToPathToQueryNode, summaryBatchSize
-
-
Constructor Summary
Constructors Constructor Description PathQueryExecutor(ObjectStore os, Profile profile, BagQueryRunner bagQueryRunner, BagManager bagManager)
Constructor with necessary objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExportResultsIterator
execute(PathQuery pathQuery)
Executes object store query and returns results as iterator over rows.ExportResultsIterator
execute(PathQuery pathQuery, int start, int limit)
Executes object store query and returns results as iterator over rows.Query
makeQuery(PathQuery pq)
Make the Lower-level Query object to run from the the higher level PathQuery one.java.lang.String
makeSql(PathQuery pathQuery)
Get the SQl that will be run on the database.void
setBatchSize(int size)
Sets batch size.-
Methods inherited from class org.intermine.api.query.QueryExecutor
count, makeSummaryQuery, makeSummaryQuery, makeSummaryQuery, summariseQuery, summariseQuery, summariseQuery, uniqueColumnValues, updateQueryToPathToQueryNode
-
-
-
-
Field Detail
-
DEFAULT_BATCH_SIZE
public static final int DEFAULT_BATCH_SIZE
default batch size- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PathQueryExecutor
public PathQueryExecutor(ObjectStore os, Profile profile, BagQueryRunner bagQueryRunner, BagManager bagManager)
Constructor with necessary objects.- Parameters:
os
- the ObjectStore to run the query inprofile
- the user executing the query - for access to saved listsbagQueryRunner
- for executing bag searches in queriesbagManager
- access to global and user bags
-
-
Method Detail
-
setBatchSize
public void setBatchSize(int size)
Sets batch size.- Parameters:
size
- batch size
-
execute
public ExportResultsIterator execute(PathQuery pathQuery) throws ObjectStoreException
Executes object store query and returns results as iterator over rows. Every row is a list of result elements.- Parameters:
pathQuery
- path query to be executed- Returns:
- results
- Throws:
ObjectStoreException
- if something goes wrong with the database
-
execute
public ExportResultsIterator execute(PathQuery pathQuery, int start, int limit) throws ObjectStoreException
Executes object store query and returns results as iterator over rows. Every row is a list of result elements.- Parameters:
pathQuery
- path query to be executedstart
- index of first result which will be retrieved. It can be very slow, it fetches results from database from index 0 and just throws away all before start index.limit
- maximum number of results- Returns:
- results
- Throws:
ObjectStoreException
- if fail to execute query
-
makeQuery
public Query makeQuery(PathQuery pq) throws ObjectStoreException
Make the Lower-level Query object to run from the the higher level PathQuery one.- Specified by:
makeQuery
in classQueryExecutor
- Parameters:
pq
- the PathQuery to translate.- Returns:
- The Query to run.
- Throws:
ObjectStoreException
- if there is a problem making the query.
-
makeSql
public java.lang.String makeSql(PathQuery pathQuery) throws ObjectStoreException
Get the SQl that will be run on the database.- Parameters:
pathQuery
- The path-query to run.- Returns:
- An SQL command.
- Throws:
ObjectStoreException
- If something goes wrong.
-
-