Interface QueryExtensionHandler

All Superinterfaces:
ExtensionHandler

public interface QueryExtensionHandler extends ExtensionHandler
Extension handler (generally for DAO usage) that allows contribution to a query (presumably from another module).
Author:
Jeff Fischer
  • Method Details

    • setup

      ExtensionResultStatusType setup(Class<?> type, String[] config)
      Perform any setup operations. This is usually done before executing the query and can serve to prepare the BroadleafRequestContext (if applicable).
      Parameters:
      type - the class type for the query (can be null)
      config - pass information to the handler, perhaps to be used by the handler to determine suitability (can be null)
      Returns:
      the status of the extension operation
    • refineRetrieve

      ExtensionResultStatusType refineRetrieve(Class<?> type, String[] config, jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.CriteriaQuery criteria, jakarta.persistence.criteria.Root root, List<jakarta.persistence.criteria.Predicate> restrictions)
      Add additional restrictions to the fetch query
      Parameters:
      type - the class type for the query (can be null)
      config - pass information to the handler, perhaps to be used by the handler to determine suitability (can be null)
      builder -
      criteria -
      root -
      restrictions - any additional JPA criteria restrictions should be added here
      Returns:
      the status of the extension operation
    • refineOrder

      ExtensionResultStatusType refineOrder(Class<?> type, String[] config, jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.CriteriaQuery criteria, jakarta.persistence.criteria.Root root, List<jakarta.persistence.criteria.Order> sorts)
      Add sorting to the fetch query
      Parameters:
      type - the class type for the query (can be null)
      config - pass information to the handler, perhaps to be used by the handler to determine suitability (can be null)
      builder -
      criteria -
      root -
      sorts - any additional JPA order expressions should be added here
      Returns:
      the status of the extension operation
    • refineResults

      ExtensionResultStatusType refineResults(Class<?> type, String[] config, List queryResults, ExtensionResultHolder<List> response)
      Filter the results from the database in Java
      Parameters:
      type - the class type for the query (can be null)
      config - pass information to the handler, perhaps to be used by the handler to determine suitability (can be null)
      queryResults - the results of the fetch query from the database
      response - the container for the filtered results
      Returns:
      the status of the extension operation
    • breakdown

      ExtensionResultStatusType breakdown(Class<?> type, String[] config)
      Perform any breakdown operations. This is usually done after executing the query and can serve to reset the BroadleafRequestContext (if applicable)
      Parameters:
      type - the class type for the query (can be null)
      config - pass information to the handler, perhaps to be used by the handler to determine suitability (can be null)
      Returns:
      the status of the extension operation