Class QueryHelperImpl

java.lang.Object
org.broadleafcommerce.common.persistence.QueryHelperImpl
All Implemented Interfaces:
QueryHelper, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Component("blQueryHelper") public class QueryHelperImpl extends Object implements QueryHelper, org.springframework.context.ApplicationContextAware
Default implementation of QueryHelper. Utilizes the BroadleafRequestContext to store query hints in a ThreadLocal context.
Author:
Jeff Fischer
  • Constructor Details

    • QueryHelperImpl

      public QueryHelperImpl()
  • Method Details

    • getSingleton

      public static QueryHelper getSingleton()
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • getResultListWithHint

      public <T> List<T> getResultListWithHint(jakarta.persistence.TypedQuery<T> query, String hintKey, Object hintValue)
      Specified by:
      getResultListWithHint in interface QueryHelper
    • getSingleResultWithHint

      public <T> T getSingleResultWithHint(jakarta.persistence.TypedQuery<T> query, String hintKey, Object hintValue)
      Specified by:
      getSingleResultWithHint in interface QueryHelper
    • getResultListWithHint

      public List getResultListWithHint(jakarta.persistence.Query query, String hintKey, Object hintValue)
      Specified by:
      getResultListWithHint in interface QueryHelper
    • getSingleResultWithHint

      public Object getSingleResultWithHint(jakarta.persistence.Query query, String hintKey, Object hintValue)
      Specified by:
      getSingleResultWithHint in interface QueryHelper
    • getQueryHint

      public Object getQueryHint(String hintKey)
      Specified by:
      getQueryHint in interface QueryHelper