Class 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 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 in
        profile - the user executing the query - for access to saved lists
        bagQueryRunner - for executing bag searches in queries
        bagManager - 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 executed
        start - 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
      • 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.