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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetQueryHint
(String hintKey) getResultListWithHint
(jakarta.persistence.Query query, String hintKey, Object hintValue) <T> List<T>
getResultListWithHint
(jakarta.persistence.TypedQuery<T> query, String hintKey, Object hintValue) getSingleResultWithHint
(jakarta.persistence.Query query, String hintKey, Object hintValue) <T> T
getSingleResultWithHint
(jakarta.persistence.TypedQuery<T> query, String hintKey, Object hintValue) static QueryHelper
void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext)
-
Constructor Details
-
QueryHelperImpl
public QueryHelperImpl()
-
-
Method Details
-
getSingleton
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContext
in interfaceorg.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 interfaceQueryHelper
-
getSingleResultWithHint
public <T> T getSingleResultWithHint(jakarta.persistence.TypedQuery<T> query, String hintKey, Object hintValue) - Specified by:
getSingleResultWithHint
in interfaceQueryHelper
-
getResultListWithHint
public List getResultListWithHint(jakarta.persistence.Query query, String hintKey, Object hintValue) - Specified by:
getResultListWithHint
in interfaceQueryHelper
-
getSingleResultWithHint
public Object getSingleResultWithHint(jakarta.persistence.Query query, String hintKey, Object hintValue) - Specified by:
getSingleResultWithHint
in interfaceQueryHelper
-
getQueryHint
- Specified by:
getQueryHint
in interfaceQueryHelper
-