Class ItemQuery<I extends BasicItem>

  • All Implemented Interfaces:
    EntityQuery, HqlQuery, Query

    public class ItemQuery<I extends BasicItem>
    extends AbstractEntityQuery
    An implementation of the Query interface that returns item objects. This type of query is used for all items except those that are batchable, for example reporters and raw data. The result of a query can be returned as a list or an iterator.
    Version:
    2.0
    Author:
    Nicklas
    Last modified
    $Date: 2017-05-22 14:35:27 +0200 (må, 22 maj 2017) $
    • Field Detail

      • itemClass

        private final Class<I extends BasicItem> itemClass
        The class of the item objects that are returned.
      • dataClass

        private final Class<? extends BasicData> dataClass
        The data layer class of the item objects that are returned.
    • Constructor Detail

      • ItemQuery

        ItemQuery​(Class<I> itemClass)
        Create a new query for the specified item, using the default optional runtime filter.
        Parameters:
        itemClass - The class of the item objects that are returned
      • ItemQuery

        ItemQuery​(Class<I> itemClass,
                  QueryRuntimeFilter optionalFilter)
        Create a new query for the specified item, using a non-default optional runtime filter.
        Parameters:
        itemClass - The class of the item objects that are returned
        optionalFilter - A runtime filter replacing the default optional filter or null to not use any optional filter
    • Method Detail

      • list

        public ItemResultList<I> list​(DbControl dc)
                               throws BaseException
        Execute the query and return the results as a list.
        Parameters:
        dc - The DbControl used to access the database and check permissions
        Throws:
        BaseException - If there is an error
      • iterate

        public ItemResultIterator<I> iterate​(DbControl dc)
                                      throws BaseException
        Execute the query and return the results as an iterator.
        Parameters:
        dc - The DbControl used to access the database and check permissions
        Throws:
        BaseException - If there is an error