Class ItemListFinder<T extends HarmonieItem>

java.lang.Object
eu.acclimatize.unison.ItemListFinder<T>

public class ItemListFinder<T extends HarmonieItem> extends Object
A class that finds a list of items based on a JPQL query.
  • Constructor Details

    • ItemListFinder

      public ItemListFinder(javax.persistence.EntityManager entityManager, String query, CacheSupport cacheSupport, Class<T> queryClass)
      Creates an instance of ItemListFinder.
      Parameters:
      entityManager - The JPA entity manager.
      query - The query to be executed.
      cacheSupport - Adds vary and cache control headers to responses.
      queryClass - Used to create typed queries.
  • Method Details

    • find

      public List<T> find(javax.servlet.http.HttpServletResponse response, String location, Date fromDate, Date toDate)
      Returns a list of items based on the query parameters.
      Parameters:
      response - The HTTP servlet response used to add HTTP vary and cache control headers.
      location - The location of the weather or precipitation value.
      fromDate - The start date (inclusive) for the query.
      toDate - The end date (inclusive) for the query.
      Returns:
      The list of items that match the query parameters.